【问题标题】:TypeError: 'Status' object is not iterable TwitterTypeError:“状态”对象不可迭代
【发布时间】:2021-12-20 16:19:27
【问题描述】:

#Obtener informationacion de otros usarios

data = api.get_user("NoticiasCaracol")
print( json.dumps(data._json, indent=4) )
with open("outfile.txt", "w") as pf:
    for obj in data:
        pf.write(json.dumps(obj) + "\n")

【问题讨论】:

    标签: python twitter tweepy


    【解决方案1】:

    我不确定您是如何使用此代码收到此错误的,因为没有涉及 Status 对象。你应该得到TypeError: 'User' object is not iterable,因为它不是,data 是你试图迭代的User 对象。

    【讨论】:

      猜你喜欢
      • 2013-09-01
      • 2017-08-27
      • 2018-10-10
      • 2021-12-13
      • 2019-02-20
      • 2020-03-27
      • 2018-12-12
      • 2018-07-16
      • 2011-09-12
      相关资源
      最近更新 更多