Adding class variables to defined class
<p>I'm a little confused on this particular problem and I have had this trouble for quite sometime now. The problem is that I don't know how to properly add a new class variable to an already defined class. In my scenario, I am using the tweepy module and using its Streaming API in order to get twitter messages that contain 'lol' in them.</p>

<p><strong>Here is the code so far:</strong></p>

<pre><code>import tweepy

class StreamListener(tweepy.StreamListener):
    #I want to add some code here in order to open a file

    def on_status(self, status):
        try:
            #Rather than printing here I would like to write to the file
            print status.text
        except:
            self.textOut.close()

    auth1 = tweepy.auth.OAuthHandler(XXXXX, XXXX)
    auth1.set_access_token(XXXXX, XXXXX)
    api = tweepy.API(auth1)

    textOut = open('twitterMessages.txt')
    l = StreamListener()
    streamer = tweepy.Stream(auth=auth1, listener=l, timeout=3000000000 )
    setTerms = ['lol', 'Lol', 'LOL']
    streamer.filter(None,setTerms)
</code></pre>

<p>Look at the comments I made. I want to open a file to begin with and write to the file. The problem is when I create an <strong>init</strong> method, it seems to override the original <strong>init</strong> method.</p>
