3
我期待关注遵循我的用户,但我没有在Tweepy中关注。我有逻辑,但我的问题是语法。跟随用户在Tweepy
for follower in followers_list:
if follower not in friends_list:
to_follow.append(follower)
print to_follow
for follower in to_follow:
print follower
api.follow(follower)
有谁知道我应该用什么遵循以人(取代api.follow,不工作的)
create_friendship就是我要找的,但是,它说我需要进行身份验证。任何人都知道我的方式,我可以使用create_friendship与阵列与我的人跟随? – 2011-05-10 03:55:05
一个非相关的建议:你的第一个循环可能被[list comprehenstion](http://docs.python.org/tutorial/datastructures.html#list-comprehensions)取代:'to_follow = [followers_list中的追随者如果追随者不在friends_list中]'。我知道它不能解决你的问题,但我认为它可以是你的代码更pythonic :) – brandizzi 2011-10-10 18:00:41