To access to tweets from python the following link is useful:

http://www.geeksforgeeks.org/twitter-sentiment-analysis-using-python/

 

when I tried it I received bad authentication error. The reason was that I was using pydev and int imported the following libraries:

from examples.oauth import access_token, access_token_secret
from oauthlib.uri_validate import query