def check_click2(self, w):
"""
This function choose the last paramter, and then call the trip_planer function to design the travel route
for users automatically including the attractions, hotels and restaurant recommendations based on their prefenrances,
and output the results in a txt file.
Parameters:
w: tk.Listbox()
Execptions:
catch IndexError exceptions to let user choose some stuff in the listbox
"""
try:
if (not w.curselection()):
raise IndexError
elif w.get(w.curselection()) == 'Tight Schedule':
t = trip_plan(Time, Bugdet, 2)
t.trip_planer()
elif w.get(w.curselection()) == 'Flexible Schedule':
t = trip_plan(Time, Bugdet, 1)
t.trip_planer()
except IndexError:
messagebox.showwarning("Error", "Please select one of the items in the listbox")
评论列表
文章目录