/+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:
85
85
        menu()
86
86
 
87
87
 
88
 
def dbAdd(): ##TODO: rename to dbCmd or somthing.
 
88
def dbAdd():
89
89
        print("DEBUG: running dbAdd()")
90
 
        query = awnsht.questionAndReturn() #kallar annan fil.
 
90
        query = awnsht.questionAndReturn()
91
91
        print(query)
92
 
        print("commit this query to DB?")
93
 
        
94
 
        q = str(input("y/n > "))
95
 
        if(q == "n"):
96
 
                menu()
97
 
        if(q == "y"):
98
 
                db.execute(query)
99
 
                conn.commit()
100
 
                menu()
101
 
        else:
102
 
                print("== no input enterd assuming yes ==")
103
 
                db.execute(query)
104
 
                conn.commit()
105
 
                menu()
106
 
        
 
92
        menu()
 
93
 
107
94
 
108
95
#==================== end function setion ==================
109
96