Not able to access twitter after a lot of try
Question: I work on windows 7 and i am trying to access twitter using tweepy and even
twitter1.14.2-python.But i am not able crack it. Help needed.

_**TWEEPY_**

    
    
    import tweepy
    
    OAUTH_TOKEN = "defined here"
    OAUTH_SECRET = "defined here"
    CONSUMER_KEY = "defined here"
    CONSUMER_SECRET = "defined here"
    
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(OAUTH_TOKEN, OAUTH_SECRET)
    
    api = API.GetUserTimeline(screen_name="yyy")
    

Error : name 'API' is not defined

_**TWITTER 1.14.2_**

    
    
    import twitter
    from twitter import *
    
    tw = Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET,CONSUMER_KEY, CONSUMER_SECRET))
    tw.statuses.home_timeline()
    tw.statuses.user_timeline(screen_name="yyy")
    

Error : No module named OAuth

_Where i am going wrong ?_


Answer: As there is no `GetUserTimeline` defined/declared in
[tweepy.API](http://pythonhosted.org/tweepy/html/api.html#tweepy-api-twitter-
api-wrapper) class, so am asuming that you intend to try the `GetUserTimeline`
method of [twitter.Api](http://inventwithpython.com/twitter.html#Api-
GetUserTimeline) class.

The `API` is exposed via the `twitter.Api` class.

To create an instance of the `twitter.Api` class:

    
    
    >>> import twitter
    >>> api = twitter.Api()
    

To create an instance of the `twitter.Api` with login credentials.

    
    
    >>> api = twitter.Api(consumer_key='consumer_key', 
              consumer_secret='consumer_secret', access_token_key='access_token', 
              access_token_secret='access_token_secret') 
    

To fetch a single user's public status messages, where `user` is either a
`Twitter "short name" or their user id`

    
    
    >>> statuses = api.GetUserTimeline(user)
    >>> print [s.text for s in statuses]
    

