luofeiyu <elearn2...@gmail.com> 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('development.db')
>>> cur = con.cursor()
>>> res = cur.execute("select * from sqlite_master where type='table'")
>>> print(list(res))
[('table', 'clubs', 'clubs', 2, 'CREATE TABLE clubs....)]

See http://www.sqlite.org/faq.html#q7 for details.

hth,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to