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