Skip to content

Commit 998b1a9

Browse files
committed
Removed unnecessary comments and added new commments
1 parent 12b28eb commit 998b1a9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Python/Direct Flight Route Finder/direct_flight_route_finder.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import tkinter.messagebox as mbox
88
import pandas as pd
99

10-
10+
# created main window
1111
window = Tk()
1212
window.geometry("1000x700")
1313
window.title("Direct Flight Route Finder")
1414

15-
# ---------------------------------------------------------
15+
# ------------------- for adding gif image in main winfdow --------------------------------------
1616
frameCnt = 3
1717
frames = [PhotoImage(file='Images/flight.gif',format = 'gif -index %i' %(i)) for i in range(frameCnt)]
1818

@@ -33,18 +33,14 @@ def update(ind):
3333
window.after(0, update, 0)
3434
# --------------------------------------------------------------------
3535

36+
# read the data from the csv file
3637
data = pd.read_csv("flight1z.csv")
3738
source_airport_list = data["source_airport"].tolist()
3839
source_airport_id_list = data["source_airport_id"].tolist()
3940
destination_airport_list = data["destination_airport"].tolist()
4041
destination_airport_id_list = data["destination_airport_id"].tolist()
4142

42-
# print(source_airport_list)
43-
# print(source_airport_id_list)
44-
# print(destination_airport_list)
45-
# print(destination_airport_id_list)
46-
47-
43+
# function to find if route exist
4844
def find_route():
4945
src = first_var.get()
5046
dest = second_var.get()
@@ -100,22 +96,25 @@ def find_route():
10096
second_menu.place(x=650, y=500)
10197
second_var.set("KZN") # size 1 is selected as by default, and we can
10298

103-
99+
# created find button
104100
findb = Button(window, text="FIND",command=find_route,font=("Arial", 20), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
105101
findb.place(x =200 , y =600 )
106102

103+
# function to reset the selected value
107104
def reset_label():
108105
first_var.set("AER")
109106
second_var.set("KZN")
110107

108+
# created reset button
111109
resetb = Button(window, text="RESET",command=reset_label,font=("Arial", 20), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
112110
resetb.place(x =420 , y =600 )
113111

114-
112+
# function for exiting
115113
def exit_win():
116114
if mbox.askokcancel("Exit", "Do you want to exit?"):
117115
window.destroy()
118116

117+
# created exit button
119118
exitb = Button(window, text="EXIT",command=exit_win,font=("Arial", 20), bg = "red", fg = "blue", borderwidth=3, relief="raised")
120119
exitb.place(x =660 , y =600 )
121120

0 commit comments

Comments
 (0)