Convert Tweepy Status object into JSON

后端 未结 3 1682
北荒
北荒 2020-12-01 01:41

I\'m using Tweepy to download tweets. I have a program that then writes the actual Status object to a file in text form. How do I translate this into JSON, or i

3条回答
  •  醉酒成梦
    2020-12-01 01:52

    users = api.search_users('TimHortons', 1)
    print(json.dumps(users[0]._json))
    

    Use json.dumps(users[0]._json) if object has _json. Users was only an example.

提交回复
热议问题