tweepy stream to sqlite database - invalid synatx

后端 未结 4 1753
你的背包
你的背包 2021-01-07 10:05

The code below is streaming the twitter public timeline for a variable which output any tweets to the console. I\'d like the save the same variables (status.text, status.aut

4条回答
  •  执念已碎
    2021-01-07 10:27

    You are missing a closing parenthesis on the last line of the following code (lines 34–37 from what you posted):

                cur.executemany("INSERT INTO TWEETS(?, ?, ?)", (status.text, 
                                                            status.author.screen_name, 
                                                            status.created_at, 
                                                            status.source)
    

    Just add a parenthesis to close the method call immediately after your tuple parameter.

提交回复
热议问题