Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tweepy-打印所有用户对象中的所有字段_Python_Python 2.7_Tweepy - Fatal编程技术网

Python 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

搜索了一个小时,找不到如何在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 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