我已经安装了SQLite数据库版本是3.8.2。但是当我运行Python脚本时,版本是3.6.21。我的Python代码是:
#!/Python27/python
# -*- coding: utf-8 -*-
import sqlite3 as lite
import sys
con = None
try:
con = lite.connect('test.db')
cur = con.cursor()
cur.execute('SELECT SQLITE_VERSION()')
data = cur.fetchone()
print "SQLite version: %s" % data
except lite.Error, e:
print "Error %s:" % e.args[0]
sys.exit(1)
finally:
if con:
con.close()
因此,我的代码没有错误。你知道吗
SQLite是一个嵌入式数据库;没有服务器。你知道吗
Python使用自己的SQLite库副本。 要升级它,必须升级Python,或者编译自己的Python版本。你知道吗
相关问题 更多 >
编程相关推荐