Python Tweepy-打印所有用户对象中的所有字段
搜索了一个小时,找不到如何在Tweepy中打印用户对象的字段:Python Tweepy-打印所有用户对象中的所有字段,python,python-2.7,tweepy,Python,Python 2.7,Tweepy,搜索了一个小时,找不到如何在Tweepy中打印用户对象的字段: userobjects = tweepy.API(auth).search_users('china', 20, 1) print userobjects 打印对象: <tweepy.models.User object at 0x10e69e710>, <tweepy.models.User object at 0x10e69e750>, <tweepy.models.User object a
userobjects = tweepy.API(auth).search_users('china', 20, 1)
print userobjects
打印对象:
<tweepy.models.User object at 0x10e69e710>, <tweepy.models.User object at 0x10e69e750>, <tweepy.models.User object at 0x10e469b50>, <tweepy.models.User object at 0x10e469bd0>, <tweepy.models.User object at 0x10e469cd0>, <tweepy.models.User object at 0x10e469d50>, <tweepy.models.User object at 0x10e469e10>, <tweepy.models.User object at 0x10e469e90>, <tweepy.models.User object at 0x10e469f10>, <tweepy.models.User object at 0x10e469f90>, <tweepy.models.User object at 0x10e476090>, <tweepy.models.User object at 0x10e476150>, <tweepy.models.User object at 0x10e476210>, <tweepy.models.User object at 0x10e476290>, <tweepy.models.User object at 0x10e476310>, <tweepy.models.User object at 0x10e4763d0>, <tweepy.models.User object at 0x10e476450>, <tweepy.models.User object at 0x10e4764d0>, <tweepy.models.User object at 0x10e4765d0>, <tweepy.models.User object at 0x10e476690>
,
如何打印
打印列表中第一个对象的用户名。只需迭代列表中的所有对象以及该对象中所需的任何其他字段。您是否尝试过例如userobjects[0].me().name?userobjects[0].name。这是我需要的。谢谢
print userobjects[0].name