execute sqlite3 dot commands in python

Carl Banks pavlovevidence at gmail.com
Sat Feb 6 10:29:10 CET 2010


On Feb 5, 3:19 pm, Steve Holden <st... at holdenweb.com> wrote:
> gintare statkute wrote:
> > Does anybody know if it possible to execute sqlite3 dot commands in python?
>
> > dovanotas:/pages/links# python
> > Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26)
> > [GCC 4.3.2] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import sqlite3
> >>>> sqlite3  .help
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > AttributeError: 'module' object has no attribute 'help'
>
> > the same with other commands:
> > .databases
> > .tables
> >http://www.sqlite.org/sqlite.html
>
> No.


Well actually you can, sort of.  For instance:

os.system('sqlite3 :memory: .help')


Carl Banks



More information about the Python-list mailing list