1
#!/usr/bin/env python3.1
4
""" Testing the cmd interface """
10
class commandPromt(cmd.Cmd):
14
conn = sqlite3.connect("./awnsers.sqlite")
17
startQueryShow = "select * from test1 where("
18
startQueryCount = "select count(*) from awnsers where("
22
def do_show(self,line):
23
""" Shows the query where
24
IE: select * from <table> where <Command>
26
show test2 = 1 and test = 1"""
27
query = commandPromt.startQueryShow + line + commandPromt.endQuery
29
result = commandPromt.db.execute(query)
31
print("Dave, I can not show you that....")
36
def do_count(self,line):
37
""" counts the query where
38
IE: select count(*) from <table> where <Command>
40
count test2 = 1 and test = 1"""
41
query = commandPromt.startQueryCount + line + commandPromt.endQuery
43
result = commandPromt.db.execute(query)
45
print("Dave, I can not count that....")
51
def do_exit(self,line):
52
import awnsers_and_db_edit
53
print("====== returning to man menu ======")
54
awnsers_and_db_edit.menu()
56
def de_EOF(self, line):