开发者

How can I loop this script every 30 seconds?

I want to loop this script every 30 seconds.

tweets = tweepy.Cursor(api.search_tweets, q='safe dev', lang='en', tweet_m开发者_如何学Pythonode='extended').items(100)
print(tweet.full_text, tweet.created_at)

I tried while true but it's not showing results.



import time 


for index in range(0 , to_numbers_of_loops):
    #here you can define the time you want to run the script in your case 30 seconds 
    time.sleep(30)
    tweets = tweepy.Cursor(api.search_tweets, q='safe dev', lang='en', tweet_mode='extended').items(100)
    print(tweet.full_text, tweet.created_at)


0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜