我正在一个项目的中间,我试图从特定的twitter用户(在python中)导入一些tweet。我被卡住了,我找不到任何方法可以将推文从我存储推文的最终列表中排除。在下面可以找到我的代码。有帮助吗?
import tweepy
consumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
consumer_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
name1 = ""
tweetCount1 = 5
results1 = api.user_timeline(
id=name1, count=tweetCount1, tweet_mode='extended',)
a = []
for tweet in results1:
a.append(tweet.full_text)
print(a)
print(type(a))