Created
February 2, 2013 23:23
-
-
Save ninux/4699711 to your computer and use it in GitHub Desktop.
read from sqlite to file
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sqlite3 as lite | |
import sys | |
con = lite.connect('datenbank2') | |
id_ctr = 10 | |
with con: | |
cur = con.cursor() | |
cur.execute('SELECT vorname, nachname FROM member WHERE id=10') | |
rows = cur.fetchall() | |
for row in rows: | |
print row | |
string = str(row) | |
f = open('results', 'r+') | |
f.write(string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment