Skip to content

Instantly share code, notes, and snippets.

@BlogBlocks
Last active July 18, 2018 03:33
Show Gist options
  • Select an option

  • Save BlogBlocks/8a940c83093f6fd653bf2a27efa81d4e to your computer and use it in GitHub Desktop.

Select an option

Save BlogBlocks/8a940c83093f6fd653bf2a27efa81d4e to your computer and use it in GitHub Desktop.
# Useage: python GistIndex.py
# Prints an index of all posts in the database created by post2gist.py
import sqlite3
def Index():
database ="GISTstore/gist.db"
conn = sqlite3.connect(database)
c = conn.cursor()
for row in c.execute('SELECT rowid, content, description, filename FROM gist \
WHERE content = ?', ("Index",)):
print row[0],row[1],row[2],row[3]
if __name__ == "__main__":
Index()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment