/+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: Gusatv Hartvigsson
  • Date: 2011-01-17 13:05:47 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20110117130547-mt3opoh1ktoe08vo
Added a few questions to the program, made use of the sqlAwnsersStart.sql"
file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        query = awnsht.questionAndReturn() #kallar annan fil.
91
91
        print(query)
92
92
        print("commit this query to DB?")
93
 
        dbCommitString(query)
94
93
        
95
 
def dbCommitString(query):
96
94
        q = str(input("y/n > "))
97
 
        q = q.lower() #save my life
98
95
        if(q == "n"):
99
96
                menu()
100
97
        if(q == "y"):
102
99
                conn.commit()
103
100
                menu()
104
101
        else:
105
 
                print("== Enter a valid input ==")
106
 
                dbCommitString(query)
 
102
                print("== no input enterd assuming yes ==")
 
103
                db.execute(query)
 
104
                conn.commit()
 
105
                menu()
107
106
        
108
107
 
109
108
#==================== end function setion ==================