问题描述
我正在使用Python库处理脚本来访问Twitter API。
对于脚本的这一部分,我想检查当前用户是否已将其匹配到already_followed
列表(类似于accounts
列表)之后。
我能够在第一个for account..
循环内访问列表,但是由于某些原因,我 无法在第二个 for user in tweepy.Cursor..
循环内访问列表。 / p>
我不太了解为什么会发生这种情况,这使我无法检查是否已经关注了当前用户。
already_followed = ['account1','account2','account3']
accounts = ['account1','account3']
for account in accounts:
print(accounts) # This works!
for user in tweepy.Cursor(api.followers,screen_name = account).items():
print(already_followed) # This does not work,why?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)