我想你做了以下事情?
$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> sqlite test.db
File "<stdin>", line 1
sqlite test.db
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
试试这个:
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
cursor.execute('''Your query goes here''')
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请查看python2或python3的sqlite文档
| 归档时间: |
|
| 查看次数: |
3934 次 |
| 最近记录: |