我是一个python新手,但我想知道如何创建一个循环,以便下面的代码可以在多个twitter id上运行,而不仅仅是“4330165050859037888”?你知道吗
到目前为止,我已经:
import tweepy
consumer_key=""
consumer_secret=""
access_key = ""
access_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
def get_retweet_count(tweet_id):
tweet = api.get_status(tweet_id)
return tweet.retweet_count
print get_retweet_count( '433016508592037888')
任何帮助都会很好。你知道吗
如果您的id在列表中:
例如:
id_list = [id, id, id, id, id]
# imagine those are id numbers :)
然后你可以这样做:
有关for循环和python循环的一般信息,请单击here和here(codeacademy, python tutorials)并单击google;)
相关问题 更多 >
编程相关推荐