def btn_click_createAirline(create_btn):#..............................................................................
    create_btn.config(state='disabled')
    create_btn.config(text="Airline Created!")

    db.create_airlines(global_airline_Name)
예제 #2
0
"""

import DB_UTIL
import randdata as rd
conobj = DB_UTIL.db_connect() #Connect to the DB

#So now that we're connected, lets start adding things.

#for i in range(0, len(customers)):
#    DB_UTIL.create_customer(conobj, customers[i])

for i in range(0, len(rd.airports)):
    DB_UTIL.create_airports(rd.airports[i][0], rd.airports[i][1], rd.airports[i][2])

for i in range(0, len(rd.airlines)):
    DB_UTIL.create_airlines(rd.airlines[i])

for i in range(0, len(rd.flights)):
    DB_UTIL.create_flights(rd.flights[i][0], rd.flights[i][1], rd.flights[i][2], rd.flights[i][3], rd.flights[i][4], rd.flights[i][5], rd.flights[i][6], rd.flights[i][7])

#Now, lets see if we've successfully added all these to the DB.

print(DB_UTIL.queryexec('SELECT * FROM Flights')) #This is hardcoded SQL, not the best way to do this, but it'll give us a glimpse at whether this works or not. Do avoid sing this though.

"""
If console returns something like:
$ python ex1.py
2.6.0
[(1, 'Paul', 'Pluszczewicz'), (2, 'Martin', 'Sendrowicz'), (3, 'Mohammed', 'Rahat'), (4, 'Sateesh', 'Mane'), (5, 'Joe', 'Schmo'), (6, 'Duncan', 'Donut'), (7, 'Bill', 'Gates')]

This means all is working well. Excellent!