Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.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 循环在twitter上搜索列表中的各种元素_Python_List_Loops_Twitter_Tweepy - Fatal编程技术网

Python 循环在twitter上搜索列表中的各种元素

Python 循环在twitter上搜索列表中的各种元素,python,list,loops,twitter,tweepy,Python,List,Loops,Twitter,Tweepy,我使用tweepy从INF\u列表中的每个用户返回20条推文。我试图通过一个循环来实现这一点,以便它覆盖所有用户。但是,程序似乎只返回对最后一个用户的搜索 提前谢谢 saida = [] for users in inf_list: busca = users data = "2021-04-12" busca_tt = busca + " -filter:retweets" tweets = tw.Cursor(api.

我使用tweepy从INF\u列表中的每个用户返回20条推文。我试图通过一个循环来实现这一点,以便它覆盖所有用户。但是,程序似乎只返回对最后一个用户的搜索

提前谢谢

saida = []
for users in inf_list:
    busca =  users
    data = "2021-04-12"
    busca_tt = busca + " -filter:retweets"
    tweets = tw.Cursor(api.search,
              q=busca_tt,
              lang="pt-br",
              since=data).items(20)
    saida.append(tweets)
print (saida)