ost recent call last):
>File "", line 1, in
> sqlite3.OperationalError: near ".": syntax error
>
>
> why " cur.execute('.tables') " can't get output?
.tables is a feature of the sqlite console, not part of sqlite's
luofeiyu writes:
> why " cur.execute('.tables') " can't get output?
Most probably because that is not an SQL statement, but a command
implemented by the SQLite command line client.
To get the list of tables, the following may work for you:
>>> import sqlite3
>>> con = sqlite3.connect('devel
rofit
sqlite>
import slqite3
con = sqlite3.connect('F:\\workspace\\china\\data\\china.sqlite')
cur = con.cursor()
cur.execute('.tables')
Traceback (most recent call last):
File "", line 1, in
sqlite3.OperationalError: ne
rofit
sqlite>
import slqite3
con = sqlite3.connect('F:\\workspace\\china\\data\\china.sqlite')
cur = con.cursor()
cur.execute('.tables')
Traceback (most recent call last):
File "", line 1, in
sqlite3.OperationalError: near ".