Created
October 3, 2014 14:56
-
-
Save mjpieters/ddc8ea0a3dc41e07810e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import sqlite3 | |
>>> conn = sqlite3.connect(':memory:') | |
>>> cursor = conn.cursor() | |
>>> cursor.execute('CREATE TABLE demo (foo PRIMARY KEY, bar INTEGER, spam TEXT, eggs INTEGER NOT NULL DEFAULT 0)') | |
<sqlite3.Cursor object at 0x1048c43b0> | |
>>> cursor.execute('PRAGMA table_info(demo)') | |
<sqlite3.Cursor object at 0x1048c43b0> | |
>>> [r[1] for r in cursor] | |
[u'foo', u'bar', u'spam', u'eggs'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment