def __init__(self, top=None):
    top.geometry('732x443+327+147')
    top.title('Bus Ticketing System')
    self.style = ttk.Style()
    font10 = '-family {Wide Latin} -size 10 -weight bold -slant roman -underline 0 -overstrike 0'
    font15 = '-family {Snap ITC} -size 20 -weight bold -slant roman -underline 1 -overstrike 0'
    font17 = '-family {Segoe UI} -size 10 -weight bold -slant roman -underline 0 -overstrike 0'
    font18 = '-family {Segoe UI} -size 11 -weight bold -slant roman -underline 0 -overstrike 0'
    Date1 = StringVar()
    now = datetime.datetime.now()
    Date1.set(now.strftime('%d-%m-%Y  %I:%M:%S:%p'))
    with open('Tickets.txt') as infile:
        characters = 0
        for (lineno, line) in enumerate(infile, 1):
            wordslist = line.split()
            characters += sum((len(word) for word in wordslist))
    ticketno = StringVar()
    ticket_number = characters
    ticketno.set(ticket_number)
    bg = PhotoImage(file='C:\\bus4.png')
    self.frame_Booking_Panel = Frame(top)
    self.frame_Booking_Panel.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
    self.frame_Booking_Panel.configure(relief=GROOVE)
    self.frame_Booking_Panel.configure(borderwidth='5')
    self.frame_Booking_Panel.configure(background='#ADD8E6')
    self.back_ground = Label(self.frame_Booking_Panel, image=bg)
    self.back_ground.img = bg
    self.back_ground.place(relx=0.14, rely=0.05, height=732, width=443)
    self.back_ground.pack()
    self.bus_Service = Label(self.frame_Booking_Panel)
    self.bus_Service.place(relx=0.14, rely=0.05, height=21, width=544)
    self.bus_Service.configure(background='#ADD8E6')
    self.bus_Service.configure(font=font15)
    self.bus_Service.configure(text='Bus Service')
    self.ticket_No = Label(self.frame_Booking_Panel)
    self.ticket_No.place(relx=0.04, rely=0.18, height=21, width=84)
    self.ticket_No.configure(background='#E6E6FA')
    self.ticket_No.configure(font=font18)
    self.ticket_No.configure(text='Ticket No. : ')
    self.tno = Label(self.frame_Booking_Panel)
    self.tno.place(relx=0.15, rely=0.18, height=21, width=30)
    self.tno.configure(background='#E6E6FA')
    self.tno.configure(font=font18)
    self.tno.configure(textvariable=ticketno)
    self.bus_id = Label(self.frame_Booking_Panel)
    self.bus_id.place(relx=0.75, rely=0.16, height=21, width=119)
    self.bus_id.configure(background='#E6E6FA')
    self.bus_id.configure(font=font18)
    self.bus_id.configure(text='Bus : JFBS0001')
    self.boarding_lbl = Label(self.frame_Booking_Panel)
    self.boarding_lbl.place(relx=0.04, rely=0.32, height=23, width=84)
    self.boarding_lbl.configure(background='#DCAE96')
    self.boarding_lbl.configure(font=font17)
    self.boarding_lbl.configure(text='Boarding :')
    self.destination_lbl = Label(self.frame_Booking_Panel)
    self.destination_lbl.place(relx=0.52, rely=0.32, height=21, width=134)
    self.destination_lbl.configure(background='#DCAE96')
    self.destination_lbl.configure(font=font18)
    self.destination_lbl.configure(text='Destination :')
    self.boarding_Combo = ttk.Combobox(self.frame_Booking_Panel, state='readonly', values=list(bus_stops.keys()))
    self.boarding_Combo.place(relx=0.19, rely=0.32, relheight=0.05, relwidth=0.2)
    self.boarding_Combo.set('Select Boarding')
    self.boarding_Combo.bind('<<ComboboxSelected>>', self.bus_Stops)
    self.des_Combo = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.des_Combo.place(relx=0.74, rely=0.32, relheight=0.05, relwidth=0.2)
    self.des_Combo.bind('<<ComboboxSelected>>')
    self.des_Combo.set('Select Destination')
    self.passengers_lbl = Label(self.frame_Booking_Panel)
    self.passengers_lbl.place(relx=0.04, rely=0.47, height=21, width=114)
    self.passengers_lbl.configure(background='#E6E6FA')
    self.passengers_lbl.configure(font=font18)
    self.passengers_lbl.configure(text='Passenger(s) :')
    self.no_of_Adult = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.no_of_Adult.place(relx=0.16, rely=0.56, relheight=0.05, relwidth=0.15)
    self.no_of_Adult['values'] = (0, 1, 2, 3)
    self.no_of_Adult.set('Select Adult(s)')
    self.no_of_Adult.bind('<<ComboboxSelected>>')
    self.no_of_Child = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.no_of_Child.place(relx=0.16, rely=0.65, relheight=0.05, relwidth=0.15)
    self.no_of_Child['values'] = (0, 1, 2, 3)
    self.no_of_Child.set('Select Child(s)')
    self.no_of_Child.bind('<<ComboboxSelected>>')
    self.book_Button = Button(self.frame_Booking_Panel)
    self.book_Button.place(relx=0.78, rely=0.62, height=24, width=107)
    self.book_Button.configure(background='#008040')
    self.book_Button.configure(font=font17)
    self.book_Button.configure(text='Book')
    self.book_Button.configure(command=self.booked)
    self.exit_Button = Button(self.frame_Booking_Panel)
    self.exit_Button.place(relx=0.78, rely=0.92, height=24, width=107)
    self.exit_Button.configure(background='#008040')
    self.exit_Button.configure(font=font17)
    self.exit_Button.configure(text='Exit')
    self.exit_Button.configure(command=exit)
    self.reset_Button = Button(self.frame_Booking_Panel)
    self.reset_Button.place(relx=0.78, rely=0.77, height=24, width=107)
    self.reset_Button.configure(background='#008040')
    self.reset_Button.configure(font=font17)
    self.reset_Button.configure(text='Reset')
    self.reset_Button.configure(command=self.reset)
    self.total_Button = Button(self.frame_Booking_Panel)
    self.total_Button.place(relx=0.78, rely=0.47, height=24, width=107)
    self.total_Button.configure(background='#008040')
    self.total_Button.configure(font=font17)
    self.total_Button.configure(text='Total')
    self.total_Button.configure(command=self.travel_Cost)
    self.lblAdultno = Label(self.frame_Booking_Panel)
    self.lblAdultno.place(relx=0.05, rely=0.56, height=21, width=64)
    self.lblAdultno.configure(background='#ff8040')
    self.lblAdultno.configure(text='Adult')
    self.lblChildno = Label(self.frame_Booking_Panel)
    self.lblChildno.place(relx=0.05, rely=0.65, height=21, width=64)
    self.lblChildno.configure(background='#ff8040')
    self.lblChildno.configure(text='Child')
    self.total_Frame = Frame(self.frame_Booking_Panel)
    self.total_Frame.place(relx=0.36, rely=0.47, relheight=0.44, relwidth=0.36)
    self.total_Frame.configure(relief=GROOVE)
    self.total_Frame.configure(borderwidth='1')
    self.total_Frame.configure(background='#ADD8E6')
    self.from1 = Label(self.total_Frame)
    self.from1.place(relx=0.08, rely=0.05, height=21, width=54)
    self.from1.configure(background='#0080ff')
    self.from1.configure(text='From :')
    self.from2 = Label(self.total_Frame)
    self.from2.place(relx=0.4, rely=0.05, height=21, width=121)
    self.from2.configure(background='#8080ff')
    self.from2.configure(highlightcolor='black')
    self.to1 = Label(self.total_Frame)
    self.to1.place(relx=0.08, rely=0.21, height=21, width=49)
    self.to1.configure(background='#0080ff')
    self.to1.configure(text='To :')
    self.to2 = Label(self.total_Frame)
    self.to2.place(relx=0.4, rely=0.21, height=21, width=121)
    self.to2.configure(background='#8080ff')
    self.no_of_Adults1 = Label(self.total_Frame)
    self.no_of_Adults1.place(relx=0.08, rely=0.36, height=21, width=55)
    self.no_of_Adults1.configure(background='#0080ff')
    self.no_of_Adults1.configure(text='Adult :')
    self.no_of_Adults2 = Label(self.total_Frame)
    self.no_of_Adults2.place(relx=0.4, rely=0.36, height=21, width=121)
    self.no_of_Adults2.configure(background='#8080ff')
    self.no_of_Child1 = Label(self.total_Frame)
    self.no_of_Child1.place(relx=0.08, rely=0.51, height=21, width=46)
    self.no_of_Child1.configure(background='#0080ff')
    self.no_of_Child1.configure(text='Child :')
    self.no_of_Child2 = Label(self.total_Frame)
    self.no_of_Child2.place(relx=0.4, rely=0.51, height=21, width=121)
    self.no_of_Child2.configure(background='#8080ff')
    self.tCost1 = Label(self.total_Frame)
    self.tCost1.place(relx=0.08, rely=0.67, height=21, width=74)
    self.tCost1.configure(background='#0080ff')
    self.tCost1.configure(text='Total (Rs.) :')
    self.tCost2 = Label(self.total_Frame)
    self.tCost2.place(relx=0.4, rely=0.67, height=21, width=121)
    self.tCost2.configure(background='#8080ff')
    self.lbltiming1 = Label(self.total_Frame)
    self.lbltiming1.place(relx=0.08, rely=0.82, height=21, width=74)
    self.lbltiming1.configure(background='#0080ff')
    self.lbltiming1.configure(text='Booking at :')
    self.lbltiming2 = Label(self.total_Frame)
    self.lbltiming2.place(relx=0.4, rely=0.82, height=21, width=135)
    self.lbltiming2.configure(background='#8080ff')
    self.lbltiming2.configure(textvariable=Date1)
def __init__(self, top=None):
    top.geometry('732x443+327+147')
    top.title('Bus Ticketing System')
    self.style = ttk.Style()
    font10 = '-family {Wide Latin} -size 10 -weight bold -slant roman -underline 0 -overstrike 0'
    font15 = '-family {Snap ITC} -size 20 -weight bold -slant roman -underline 1 -overstrike 0'
    font17 = '-family {Segoe UI} -size 10 -weight bold -slant roman -underline 0 -overstrike 0'
    font18 = '-family {Segoe UI} -size 11 -weight bold -slant roman -underline 0 -overstrike 0'
    Date1 = StringVar()
    now = datetime.datetime.now()
    Date1.set(now.strftime('%d-%m-%Y  %I:%M:%S:%p'))
    with open('Tickets.txt') as infile:
        characters = 0
        for (lineno, line) in enumerate(infile, 1):
            wordslist = line.split()
            characters += sum((len(word) for word in wordslist))
    ticketno = StringVar()
    ticket_number = characters
    ticketno.set(ticket_number)
    bg = PhotoImage(file='C:\\bus4.png')
    self.frame_Booking_Panel = Frame(top)
    self.frame_Booking_Panel.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
    self.frame_Booking_Panel.configure(relief=GROOVE)
    self.frame_Booking_Panel.configure(borderwidth='5')
    self.frame_Booking_Panel.configure(background='#ADD8E6')
    self.back_ground = Label(self.frame_Booking_Panel, image=bg)
    self.back_ground.img = bg
    self.back_ground.place(relx=0.14, rely=0.05, height=732, width=443)
    self.back_ground.pack()
    self.bus_Service = Label(self.frame_Booking_Panel)
    self.bus_Service.place(relx=0.14, rely=0.05, height=21, width=544)
    self.bus_Service.configure(background='#ADD8E6')
    self.bus_Service.configure(font=font15)
    self.bus_Service.configure(text='Bus Service')
    self.ticket_No = Label(self.frame_Booking_Panel)
    self.ticket_No.place(relx=0.04, rely=0.18, height=21, width=84)
    self.ticket_No.configure(background='#E6E6FA')
    self.ticket_No.configure(font=font18)
    self.ticket_No.configure(text='Ticket No. : ')
    self.tno = Label(self.frame_Booking_Panel)
    self.tno.place(relx=0.15, rely=0.18, height=21, width=30)
    self.tno.configure(background='#E6E6FA')
    self.tno.configure(font=font18)
    self.tno.configure(textvariable=ticketno)
    self.bus_id = Label(self.frame_Booking_Panel)
    self.bus_id.place(relx=0.75, rely=0.16, height=21, width=119)
    self.bus_id.configure(background='#E6E6FA')
    self.bus_id.configure(font=font18)
    self.bus_id.configure(text='Bus : JFBS0001')
    self.boarding_lbl = Label(self.frame_Booking_Panel)
    self.boarding_lbl.place(relx=0.04, rely=0.32, height=23, width=84)
    self.boarding_lbl.configure(background='#DCAE96')
    self.boarding_lbl.configure(font=font17)
    self.boarding_lbl.configure(text='Boarding :')
    self.destination_lbl = Label(self.frame_Booking_Panel)
    self.destination_lbl.place(relx=0.52, rely=0.32, height=21, width=134)
    self.destination_lbl.configure(background='#DCAE96')
    self.destination_lbl.configure(font=font18)
    self.destination_lbl.configure(text='Destination :')
    self.boarding_Combo = ttk.Combobox(self.frame_Booking_Panel, state='readonly', values=list(bus_stops.keys()))
    self.boarding_Combo.place(relx=0.19, rely=0.32, relheight=0.05, relwidth=0.2)
    self.boarding_Combo.set('Select Boarding')
    self.boarding_Combo.bind('<<ComboboxSelected>>', self.bus_Stops)
    self.des_Combo = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.des_Combo.place(relx=0.74, rely=0.32, relheight=0.05, relwidth=0.2)
    self.des_Combo.bind('<<ComboboxSelected>>')
    self.des_Combo.set('Select Destination')
    self.passengers_lbl = Label(self.frame_Booking_Panel)
    self.passengers_lbl.place(relx=0.04, rely=0.47, height=21, width=114)
    self.passengers_lbl.configure(background='#E6E6FA')
    self.passengers_lbl.configure(font=font18)
    self.passengers_lbl.configure(text='Passenger(s) :')
    self.no_of_Adult = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.no_of_Adult.place(relx=0.16, rely=0.56, relheight=0.05, relwidth=0.15)
    self.no_of_Adult['values'] = (0, 1, 2, 3)
    self.no_of_Adult.set('Select Adult(s)')
    self.no_of_Adult.bind('<<ComboboxSelected>>')
    self.no_of_Child = ttk.Combobox(self.frame_Booking_Panel, state='readonly')
    self.no_of_Child.place(relx=0.16, rely=0.65, relheight=0.05, relwidth=0.15)
    self.no_of_Child['values'] = (0, 1, 2, 3)
    self.no_of_Child.set('Select Child(s)')
    self.no_of_Child.bind('<<ComboboxSelected>>')
    self.book_Button = Button(self.frame_Booking_Panel)
    self.book_Button.place(relx=0.78, rely=0.62, height=24, width=107)
    self.book_Button.configure(background='#008040')
    self.book_Button.configure(font=font17)
    self.book_Button.configure(text='Book')
    self.book_Button.configure(command=self.booked)
    self.exit_Button = Button(self.frame_Booking_Panel)
    self.exit_Button.place(relx=0.78, rely=0.92, height=24, width=107)
    self.exit_Button.configure(background='#008040')
    self.exit_Button.configure(font=font17)
    self.exit_Button.configure(text='Exit')
    self.exit_Button.configure(command=exit)
    self.reset_Button = Button(self.frame_Booking_Panel)
    self.reset_Button.place(relx=0.78, rely=0.77, height=24, width=107)
    self.reset_Button.configure(background='#008040')
    self.reset_Button.configure(font=font17)
    self.reset_Button.configure(text='Reset')
    self.reset_Button.configure(command=self.reset)
    self.total_Button = Button(self.frame_Booking_Panel)
    self.total_Button.place(relx=0.78, rely=0.47, height=24, width=107)
    self.total_Button.configure(background='#008040')
    self.total_Button.configure(font=font17)
    self.total_Button.configure(text='Total')
    self.total_Button.configure(command=self.travel_Cost)
    self.lblAdultno = Label(self.frame_Booking_Panel)
    self.lblAdultno.place(relx=0.05, rely=0.56, height=21, width=64)
    self.lblAdultno.configure(background='#ff8040')
    self.lblAdultno.configure(text='Adult')
    self.lblChildno = Label(self.frame_Booking_Panel)
    self.lblChildno.place(relx=0.05, rely=0.65, height=21, width=64)
    self.lblChildno.configure(background='#ff8040')
    self.lblChildno.configure(text='Child')
    self.total_Frame = Frame(self.frame_Booking_Panel)
    self.total_Frame.place(relx=0.36, rely=0.47, relheight=0.44, relwidth=0.36)
    self.total_Frame.configure(relief=GROOVE)
    self.total_Frame.configure(borderwidth='1')
    self.total_Frame.configure(background='#ADD8E6')
    self.from1 = Label(self.total_Frame)
    self.from1.place(relx=0.08, rely=0.05, height=21, width=54)
    self.from1.configure(background='#0080ff')
    self.from1.configure(text='From :')
    self.from2 = Label(self.total_Frame)
    self.from2.place(relx=0.4, rely=0.05, height=21, width=121)
    self.from2.configure(background='#8080ff')
    self.from2.configure(highlightcolor='black')
    self.to1 = Label(self.total_Frame)
    self.to1.place(relx=0.08, rely=0.21, height=21, width=49)
    self.to1.configure(background='#0080ff')
    self.to1.configure(text='To :')
    self.to2 = Label(self.total_Frame)
    self.to2.place(relx=0.4, rely=0.21, height=21, width=121)
    self.to2.configure(background='#8080ff')
    self.no_of_Adults1 = Label(self.total_Frame)
    self.no_of_Adults1.place(relx=0.08, rely=0.36, height=21, width=55)
    self.no_of_Adults1.configure(background='#0080ff')
    self.no_of_Adults1.configure(text='Adult :')
    self.no_of_Adults2 = Label(self.total_Frame)
    self.no_of_Adults2.place(relx=0.4, rely=0.36, height=21, width=121)
    self.no_of_Adults2.configure(background='#8080ff')
    self.no_of_Child1 = Label(self.total_Frame)
    self.no_of_Child1.place(relx=0.08, rely=0.51, height=21, width=46)
    self.no_of_Child1.configure(background='#0080ff')
    self.no_of_Child1.configure(text='Child :')
    self.no_of_Child2 = Label(self.total_Frame)
    self.no_of_Child2.place(relx=0.4, rely=0.51, height=21, width=121)
    self.no_of_Child2.configure(background='#8080ff')
    self.tCost1 = Label(self.total_Frame)
    self.tCost1.place(relx=0.08, rely=0.67, height=21, width=74)
    self.tCost1.configure(background='#0080ff')
    self.tCost1.configure(text='Total (Rs.) :')
    self.tCost2 = Label(self.total_Frame)
    self.tCost2.place(relx=0.4, rely=0.67, height=21, width=121)
    self.tCost2.configure(background='#8080ff')
    self.lbltiming1 = Label(self.total_Frame)
    self.lbltiming1.place(relx=0.08, rely=0.82, height=21, width=74)
    self.lbltiming1.configure(background='#0080ff')
    self.lbltiming1.configure(text='Booking at :')
    self.lbltiming2 = Label(self.total_Frame)
    self.lbltiming2.place(relx=0.4, rely=0.82, height=21, width=135)
    self.lbltiming2.configure(background='#8080ff')
    self.lbltiming2.configure(textvariable=Date1)