#!/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>
Компилятор Python говорит, что строка 54 неверна. Я уже определил импорт JSON как SimpleJson. Приведенная выше область, где я определил импорт JSON, показан выше.
Подробнее здесь: https://stackoverflow.com/questions/410 ... ot-defined
Python 3.5.1: nameerror: имя «json» не определено [закрыто] ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Что не так с этой переменной python nameerror: имя «Thetas» не определено [закрыто]
Anonymous » » в форуме Python - 0 Ответы
- 2 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Что не так с этой переменной python nameerror: имя «Thetas» не определено [закрыто]
Anonymous » » в форуме Python - 0 Ответы
- 4 Просмотры
-
Последнее сообщение Anonymous
-