是否可以在一个进程中访问在另一个进程中创建的数据库?我试过:
空闲 #1
import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()
c.execute("create table test(testcolumn)")
c.execute("insert into test values('helloooo')")
conn.commit()
conn.close()
空闲 #2
import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()
c.execute("select * from test")
错误:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
q = c.execute("select * from test")
sqlite3.OperationalError: no such table: test