/+junk/Dataanalys

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/Dataanalys

« back to all changes in this revision

Viewing changes to awnsers_and_db_edit.py

  • Committer: Gustav Hartvigsson
  • Date: 2010-12-22 18:59:19 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20101222185919-xa4ot5ytlbiepf4w
Added a camand line interface, and finished up the awnser sheet thingy...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python3.1
 
2
#-*- coding: utf-8 -*-
 
3
 
 
4
 
2
5
import sys
3
6
import sqlite3
 
7
import awnser_sheet
 
8
import sqlCmd
4
9
 
 
10
awnsht = awnser_sheet.awnserSheet()
 
11
cmdClass = sqlCmd.commandPromt()
5
12
 
6
13
#======================= connection to DB ===========================
7
14
 
31
38
 
32
39
        print("select an option")
33
40
        print(menuOptions)
34
 
        menuOptionsInput = input(">>>>")
 
41
        menuOptionsInput = str(input(">>>>"))
35
42
 
36
43
        #ifs and thens
37
44
        if(menuOptionsInput == "1" or menuOptionsInput.lower() == "s" ):
66
73
                print( row )
67
74
        
68
75
        
69
 
        if(getQuery == None):
 
76
        if(getQuery[0] == None):
70
77
                print("No data in table.")
71
78
        
72
 
        menu()
 
79
        print("===== changing to database comand line =====")
 
80
        cmdClass.cmdloop()
73
81
 
74
82
def dbEdit():
75
83
        print("DEBUG: running dbEdit()")
79
87
 
80
88
def dbAdd():
81
89
        print("DEBUG: running dbAdd()")
82
 
        #TODO: make a function with all the questions and such.
 
90
        query = awnsht.questionAndReturn()
 
91
        print(query)
83
92
        menu()
84
93
 
85
94