title: Python 3.5.1 : NameError: name 'json' is not defined
body: <pre><code>#!/usr/bin/env python
  # encoding: utf-8
  
  import tweepy #https://github.com/tweepy/tweepy
  import json as simplejson
  
  
      #write tweet objects to JSON
      file = open('tweet.json', 'wb') 
      print ("Writing tweet objects to JSON please wait...")
      for status in alltweets:
          json.dump(status._json,file,sort_keys = True,indent = 4)
  
      #close the file
      print ("Done")
      file.close()
  
  if __name__ == '__main__':
      #pass in the username of the account you want to download
      get_all_tweets("@AlertZaAfrica")
  </code></pre>
  
  <p>The python compiler says line 54 is wrong. I already defined import json as simplejson. The above area where I defined import json is showed above.</p>