x = 0 for city in cities: sqlCommand = "INSERT INTO Arrivals VALUES('%s', '%s', '%s')" % (city, flights[x], times[x]) cHandler.execute(sqlCommand) x += 1
sqlCommand = "SELECT cities, flights, times FROM Arrivals" cHandler.execute(sqlCommand) results = cHandler.fetchall() print results
myDB.commit()
myDB.close()
Related Scripts with Example Source Code in same category :