关于在python中实现表(即小型关系数据库)的最佳方法的任何想法,而不使用任何外部数据库额外模块和当sqlite3模块被破坏或丢失时。
user:~ $ python3
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/bns/rma/local/python/lib/python3.1/sqlite3/__init__.py", line 24, in <module>
from sqlite3.dbapi2 import *
File "/bns/rma/local/python/lib/python3.1/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
>>> ^D
user:~ $ python2.7
Python 2.7 (r27:82500, Jul 28 2010, 11:39:31)
[GCC 3.4.3 (csl-sol210-3_4-branch+sol_rpath)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dcottr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/home/dcottr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
>>>