-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreader.py
More file actions
25 lines (21 loc) · 804 Bytes
/
reader.py
File metadata and controls
25 lines (21 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sqlite3
def main():
db = sqlite3.connect('database.db')
db.row_factory = sqlite3.Row
cursor = db.cursor()
cursor.execute('''SELECT id, chat_id, username FROM members''')
db.commit()
print "Table members | ID | User ID | Username"
for user in cursor:
print(" {} {} {}".format(str(user['id']), str(user['chat_id']), str(user['username'])))
cursor.execute('''SELECT id, message, response FROM messages''')
db.commit()
print ('')
for data in cursor:
print str(data['id']) + " | " + data['message'] + " | " + data['response']
print ''
cursor.execute('''SELECT id, chat_id, username FROM blacklist''')
db.commit()
for black in cursor:
print black['chat_id'] + " | " + black['username']
main()