human
Give me a the Python code you requested given the following:
I am working on the file "Caravel/Visualising Tweets.ipynb".
The first task is:
Scraping Tweets
Necessary python packages: <br>
Tweepy: https://github.com/tweepy/tweepy
$pip install tweepy
Can you write Python code for it?
assistant
#Here is the Python code you requested.

#Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream

#Variables that contains the user credentials to access Twitter API 
consumer_key= "################"
consumer_secret = "################"
access_token = "################"
access_token_secret= "################"
tweet_file_path="/home/nipun/Downloads/Twitter_scrape/Twitter_scrape.txt"
tweet_file_handle=open(tweet_file_path,"a")

#This is a basic listener that just prints received tweets to stdout.
class StdOutListener(StreamListener):

    def on_data(self, data):
        print data
        tweet_file_handle.write(str(data)+"\n")
        return True

    def on_error(self, status):
        print status


#This handles Twitter authetification and the connection to Twitter Streaming API
l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, l)

#This line filter Twitter Streams to capture data by the keywords: 'python', 'javascript', 'ruby'
stream.filter(track=['IPL2016'])