def runGUI(): lookup = Lookup() lookup.readAirport() lookup.readCountryCurrency() lookup.readCurrencyRate() ## agent = TravelAgent(lookup) app = simpleapp_tk(None) app.title('SuperSales Travel Planner') # title for GUI app.wm_iconbitmap('Airplane_silhouette.ico') # icon for GUI app.mainloop()
def main(): lookup = Lookup() lookup.readEmployee('employees.csv') lookup.readAirport() lookup.readCountryCurrency() lookup.readCurrencyRate() agent = TravelAgent(lookup) print(agent.costLeg('LAX','DUB')) result = agent.findBestRoute(agent.findPossibleRoutes(Employee("Alice","DUB","JFK","AAL","CDG","SYD"))) print(result) print(agent.getResultByName('Tom'))
# Licence: <your licence> #------------------------------------------------------------------------------- from Lookup import * from Employee import * from Airport import * from Currency import * from TravelAgent import * import csv # ----------- setting up the lookup details ------------------------------------ lookup = Lookup() lookup.readEmployee('employees.csv') lookup.readAirport() lookup.readCountryCurrency() lookup.readCurrencyRate() agent = TravelAgent(lookup) # ------------ Confirming that data is ready ----------------------------------- print('All csv data has been read.') print('Total Employees:', len(lookup.employee_info)) print('Total Airports:', len(lookup.airport_info)) print('Total Currencies:', len(lookup.currency_info)) print('Total Exchange Rates:', len(lookup.currencyrate_info)) # ------------ Basic information retrieval exercises --------------------------- print('Currency for LHR airport: ',lookup.getCurrency('LHR')) # GBP print('Exchange Rate for GBP to EUR: ',lookup.getExchangeRate('LHR')) # 1.4029 print('Latitude and Longitude of LHR airport: ',lookup.getLatLong('LHR')) # (51.4775, -0.461389)