我有一个与 3 列的 python 模块链接的电子表格。我尝试使用insert_rows
函数插入新的数据行,但它没有做任何事情,也没有抛出任何错误,这让我更难缩小问题的范围。
这是我尝试过的:
gc = pygsheets.authorize(service_file='File.json')
sh = gc.open('TwitterStream')
wks = sh[0]
t = Twython('ckey ','c_secret ')
results = t.search(q='tuberculosis', count=5, lang='en', result_type='popular',tweet_mode='extended')
all_tweets = results['statuses']
for tweet in all_tweets:
tweetString = tweet["full_text"]
userMentionList = tweet["entities"]["user_mentions"]
if len(userMentionList)>0:
for eachUserMention in userMentionList:
name = eachUserMention["screen_name"]
time = tweet["created_at"]
//This is the function
wks.insert_rows(wks.rows, number=1,values=[tweetString, name, time], inherit=True)