各位大大好 小弟非本科系生 目前自学Python3
程式码如下:(Python3.6)
import sqlite3
with sqlite3.connect('c.sqlite') as db:
c.to_sql('c',con=db,self.if_exists='append')
(c这资料是用pandas将台银牌告汇率爬取下来,参考如下网址:
https://www.youtube.com/watch?v=-c5rrzjsN34)
错误:
File "<ipython-input-56-246156207101>", line 3
c.to_sql('c',con=db,self.if_exists='append')
^
SyntaxError: keyword can't be an expression
题目只是单纯将c这资料存在数据库中
另若是把self.拿掉
则出现以下错误:
OperationalError Traceback (most recent call last)
<ipython-input-57-e5a3883ff452> in <module>()
1 import sqlite3
2 with sqlite3.connect('c.sqlite') as db: