title: How to get the data in python-twitter
body: <p>I'm new to python.
  I am using the libray called <code>python-twitter</code> to grab data of my own twitter account</p>
  
  <p>Here is my code (twitter-test.py)</p>
  
  <pre><code>import twitter
  
  api = twitter.Api(consumer_key="xxxxxxxx",
                    consumer_secret="xxxxxxxxxx",
                    access_token_key="xxxxxx-xxxx",
                    access_token_secret="xxxxxxx",
                    sleep_on_rate_limit=True)
  follower = api.GetFollowers()
  print(follower)
  </code></pre>
  
  <p>then i run <code>python3 twitter-test.py</code>
  Here is the result.</p>
  
  <pre><code>[User(ID=xxxxxxxxx, ScreenName=xxxxxxx), User(ID=xxxxxxxxx, ScreenName=xxxxxxx), User(ID=xxxxxxxxx, ScreenName=xxxxxxx), .......]
  </code></pre>
  
  <p>The api is call successfully.</p>
  
  <p>Now I want to save the result:</p>
  
  <pre><code>import json
  
  { The code same as before }
  
  json.dumps(follower)
  </code></pre>
  
  <pre><code>TypeError: Object of type User is not JSON serializable
  </code></pre>
  
  <p>Then I tried to loop the result using <code>for x in follower:</code></p>
  
  <p>but <code>x[0]</code> <code>x['ID']</code> <code>x.ID</code> all return error:</p>
  
  <pre><code>TypeError: 'User' object is not subscriptable
  </code></pre>
  
  <p>How can I extract the data from <code>User</code> Object ?</p>