def btn_click_createAirport(create_btn):#.............................................................................. create_btn.config(state='disabled') create_btn.config(text="Airport Created!") db.create_airports(global_airport_Name, 'Some-City', 'Some-Country')
Perhaps we can figure out a way to create a huge amount of these tuples and store in a file, then choose stuff randomly. We can make this happen, pretty easily. Now, we need to add these to the DB. LETS BEGIN """ 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