HOTEL MANAGEMENT USING PYTHON

PYTHON CODE:

import os

from subprocess import call


import sys


try:

    from Tkinter import *

except ImportError:

    from tkinter import *


try:

    import ttk

    py3 = False

except ImportError:

    import tkinter.ttk as ttk

    py3 = True

def click_checkinn():

    call(["python", "checkin_gui_and_program.py"])

def click_list():

    call(["python", "listgui.py"])

def click_checkout():

    call(["python", "checkoutgui.py"])

def click_getinfo():

    call(["python","getinfoui.py"])



class HOTEL_MANAGEMENT:

    def __init__(self):

        root = Tk()

        '''This class configures and populates the toplevel window.

           top is the toplevel containing window.'''

        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'

        _fgcolor = '#000000'  # X11 color: 'black'

        _compcolor = '#ffffff' # X11 color: 'white'

        _ana1color = '#ffffff' # X11 color: 'white'

        _ana2color = '#ffffff' # X11 color: 'white'

        font14 = "-family {Segoe UI} -size 15 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font16 = "-family {Swis721 BlkCn BT} -size 40 -weight bold "  \

            "-slant roman -underline 0 -overstrike 0"

        font9 = "-family {Segoe UI} -size 9 -weight normal -slant "  \

            "roman -underline 0 -overstrike 0"


        root.geometry("963x749+540+110")

        root.title("HOTEL MANAGEMENT")

        root.configure(background="#d9d9d9")

        root.configure(highlightbackground="#d9d9d9")

        root.configure(highlightcolor="black")




        self.menubar = Menu(root,font=font9,bg=_bgcolor,fg=_fgcolor)

        root.configure(menu = self.menubar)




        self.Frame1 = Frame(root)

        self.Frame1.place(relx=0.02, rely=0.03, relheight=0.94, relwidth=0.96)

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(borderwidth="2")

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(background="#d9d9d9")

        self.Frame1.configure(highlightbackground="#d9d9d9")

        self.Frame1.configure(highlightcolor="black")

        self.Frame1.configure(width=925)


        self.Message6 = Message(self.Frame1)

        self.Message6.place(relx=0.09, rely=0.01, relheight=0.15, relwidth=0.86)

        self.Message6.configure(background="#d9d9d9")

        self.Message6.configure(font=font16)

        self.Message6.configure(foreground="#000000")

        self.Message6.configure(highlightbackground="#d9d9d9")

        self.Message6.configure(highlightcolor="black")

        self.Message6.configure(text='''WELCOME''')

        self.Message6.configure(width=791)


        self.Button2 = Button(self.Frame1)

        self.Button2.place(relx=0.18, rely=0.17, height=103, width=566)

        self.Button2.configure(activebackground="#d9d9d9")

        self.Button2.configure(activeforeground="#000000")

        self.Button2.configure(background="#d9d9d9")

        self.Button2.configure(disabledforeground="#bfbfbf")

        self.Button2.configure(font=font14)

        self.Button2.configure(foreground="#000000")

        self.Button2.configure(highlightbackground="#d9d9d9")

        self.Button2.configure(highlightcolor="black")

        self.Button2.configure(pady="0")

        self.Button2.configure(text='''1.CHECK INN''')

        self.Button2.configure(width=566)

        self.Button2.configure(command=click_checkinn)


        self.Button3 = Button(self.Frame1)

        self.Button3.place(relx=0.18, rely=0.33, height=93, width=566)

        self.Button3.configure(activebackground="#d9d9d9")

        self.Button3.configure(activeforeground="#000000")

        self.Button3.configure(background="#d9d9d9")

        self.Button3.configure(disabledforeground="#bfbfbf")

        self.Button3.configure(font=font14)

        self.Button3.configure(foreground="#000000")

        self.Button3.configure(highlightbackground="#d9d9d9")

        self.Button3.configure(highlightcolor="black")

        self.Button3.configure(pady="0")

        self.Button3.configure(text='''2.SHOW GUEST LIST''')

        self.Button3.configure(width=566)

        self.Button3.configure(command=click_list)


        self.Button4 = Button(self.Frame1)

        self.Button4.place(relx=0.18, rely=0.47, height=93, width=566)

        self.Button4.configure(activebackground="#d9d9d9")

        self.Button4.configure(activeforeground="#000000")

        self.Button4.configure(background="#d9d9d9")

        self.Button4.configure(disabledforeground="#bfbfbf")

        self.Button4.configure(font=font14)

        self.Button4.configure(foreground="#000000")

        self.Button4.configure(highlightbackground="#d9d9d9")

        self.Button4.configure(highlightcolor="black")

        self.Button4.configure(pady="0")

        self.Button4.configure(text='''3.CHECK OUT''')

        self.Button4.configure(width=566)

        self.Button4.configure(command=click_checkout)


        self.Button5 = Button(self.Frame1)

        self.Button5.place(relx=0.18, rely=0.61, height=103, width=566)

        self.Button5.configure(activebackground="#d9d9d9")

        self.Button5.configure(activeforeground="#000000")

        self.Button5.configure(background="#d9d9d9")

        self.Button5.configure(disabledforeground="#bfbfbf")

        self.Button5.configure(font=font14)

        self.Button5.configure(foreground="#000000")

        self.Button5.configure(highlightbackground="#d9d9d9")

        self.Button5.configure(highlightcolor="black")

        self.Button5.configure(pady="0")

        self.Button5.configure(text='''4.GET INFO OF ANY GUEST''')

        self.Button5.configure(width=566)

        self.Button5.configure(command=click_getinfo)


        self.Button6 = Button(self.Frame1)

        self.Button6.place(relx=0.18, rely=0.77, height=103, width=566)

        self.Button6.configure(activebackground="#d9d9d9")

        self.Button6.configure(activeforeground="#000000")

        self.Button6.configure(background="#d9d9d9")

        self.Button6.configure(disabledforeground="#bfbfbf")

        self.Button6.configure(font=font14)

        self.Button6.configure(foreground="#000000")

        self.Button6.configure(highlightbackground="#d9d9d9")

        self.Button6.configure(highlightcolor="black")

        self.Button6.configure(pady="0")

        self.Button6.configure(text='''5.EXIT''')

        self.Button6.configure(width=566)

        self.Button6.configure(command=quit)

        root.mainloop()



if __name__ == '__main__':

    GUUEST=HOTEL_MANAGEMENT()

#SUB-PROGRAMS

import os

import pickle


print(

    "///////////////****************//////////////*****************/////////////////*****************///////////////////******************//////////")

print(

    "----------------------------------------------------- 5 STAR HOTEL AND RESORTS -----------------------------------------------------------------")

print(

    "//////////////****************///////////////*****************/////////////////*****************///////////////////******************//////////")


u = list()

Delux = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

Semi_Delux = (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)

General = (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)

Joint_Room = (46, 47, 48, 49, 50, 46, 47, 48, 49, 50)

m = [9]

G = []



def chk_name():

    while True:

        print("\n")

        name = input("ENTER GUEST NAME:")

        a = name.isdigit()

        if len(name) != 0 and a != True:

            return name


            break

        else:

            print("invalid input please input a valid name")

            print(" ")



def chk_add():

    while True:

        print("\n")

        address = input("ENTER GUEST ADDRESS:")

        a = address.isdigit()

        if len(address) != 0 and a != True:

            return address

            break


        else:

            print("invalid input ")

        print(" ")



def chk_mo():

    while True:

        print("\n")

        mobile_no = input("ENTER MOBILE/PNOHE NO.:")

        if mobile_no.isdigit() == True and len(mobile_no) != 0 and len(mobile_no) == 10:

            return mobile_no

            break

        else:

            print("invalid input ")

        print(" ")



def chk_day():

    while True:

        print("\n")

        no_of_days = input("ENTER NO. OF DAYS GUEST WANT TO STAY:")

        a = no_of_days.isdigit()

        if a == True and len(no_of_days) != 0:

            return no_of_days

            break

        else:

            print("invalid input ")



def chk_pay():

    while True:

        print("\n")

        op = input("Enter guest's choice:")

        a = op.isdigit()

        if len(op) != 0 and a == True and (op == "1" or op == "2"):

            op = int(op)

            return op

            break

        else:

            print("invalid input ")



class save:

    price = 0

    room = "0"


    def __init__(self):

        self.price = 0

        self.name = " "

        self.address = " "

        self.no_of_days = 0

        self.room = "0"


    def enter(self):

        self.name = chk_name()

        self.address = chk_add()

        self.mobile_no = chk_mo()

        self.no_of_days = int(chk_day())


    def tor(self):

        print("1. Delux")

        print("2. Semi-Delux")

        print("3. General")

        print("4. Joint Room")

        while True:

            ch = input("Enter guest's choice:")

            a = ch.isdigit()

            if len(ch) != 0 and a == True and (ch == "1" or ch == "2" or ch == "3" or ch == "4"):

                break

            else:

                print("invalid input ")

        ch = int(ch)

        if ch == 1:

            self.price = self.price + (2000 * self.no_of_days)

            m[0] = 1

        elif ch == 2:

            self.price = self.price + (1500 * self.no_of_days)

            m[0] = 2

        elif ch == 3:

            self.price = self.price + (1000 * self.no_of_days)

            m[0] = 3

        elif ch == 4:

            self.price = self.price + (1700 * self.no_of_days)

            m[0] = 4

        else:

            print("invalid choice")


    def payment_option(self):

        print("1. By cash")

        print("2. By credit/debit card")

        op = chk_pay()

        if op == 1:

            print("No discount.")

        elif op == 2:

            self.price = self.price - ((self.price * 10) / 100)

            print("Discount of 10%.")

        else:

            print("Invalid option.")


    def bill(self):

        print("\n")

        print("@@@@@@@@@  5 STAR HOTEL AND RESORTS  @@@@@@@@@@@@@@@@")

        print("@@@@@@@@@@@@ HAUS KHAZ,  NEW DELHI @@@@@@@@@@@@@@@@@@")

        print("@@@@@@@@@@ SERVING    GUEST   SINCE @@@@@@@@@@@@@@@@@")

        print("@@@@@@@@@@@@@@@    ###1950###       @@@@@@@@@@@@@@@@@")

        print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")

        print("NAME-", self.name)

        print("\n")

        print("ADDRESS-", self.address)

        print("\n")

        print("MOBILE NO.-", self.mobile_no)

        print("\n")

        print("YOUR TOTAL BILL IS Rs.", self.price)

        print("\n")

        if m[0] == 1:

            a = Delux

        elif m[0] == 2:


            a = Semi_Delux

        elif m[0] == 3:

            a = General

        elif m[0] == 4:

            a = Joint_Room


        G = []

        f2 = open("hotel.dat", "rb")

        try:

            while True:

                s = pickle.load(f2)

                k = s.room

                G.append(k)

                continue

        except EOFError:

            pass


        for r in a:

            if r not in G:

                print(self.name, " - room", r, "is alloted to you")

                self.room = r

                break

            else:

                continue

        self.room = r

        print("\n")

        print("@@@@@@@@@@@@@@@@@@@@ THANK YOU  @@@@@@@@@@@@@@@@@@@@@@")

        print("@@@@@@@@ HOPE YOU WOULD ENJOY OUR SERVICE @@@@@@@@@@@@")



# main


while True:

    print("\n")

    print("1.Check in")

    print("2.SHOW GUEST LIST")

    print("3.Check out")

    print("4.get info of any guest")

    print("5.EXIT")

    k = input("Enter choice:")

 if k == "1":

        a = GUEST()

        f = open("hotel.dat", "ab")

        a.enter()

        a.tor()

        a.payment_option()

        a.bill()

        pickle.dump(a, f,protocol=2)

        f.close()

    elif k == "2":

        f1 = open("hotel.dat", "rb")

        print("NAME", "\t", "\t", "ROOM NO.")

        try:

            while True:

                s = pickle.load(f1)

                print(s.name, "\t", "\t", s.room)

        except EOFError:

            pass

        f1.close()

elif k == "3":

        print("\n")

        while True:

            a = input("ENTER ROOM NO.")

            if len(a) != 0:

                break

            else:

                print("no input found")

                continue

            v = int(a)

        v = int(a)

        f = open("hotel.dat", "rb")

        f1 = open("hote.dat", "ab")

        n = 0

        try:

            while True:

                s = pickle.load(f)

                if s.room == v:

                    n = 1

                    name1=s.name


                    print(" ")

                else:

                    pickle.dump(s, f1)

        except EOFError:

            if n == 0:

                print("NO GUEST IN ROOM ", v)

            elif n == 1:


                print("THANK YOU",name1,"2 FOR VISTING US")

                print("HOPE YOU LIKE OUR SERVICE")

                print("\n")

            pass

        f.close()

        f1.close()

        os.remove("hotel.dat")

        os.rename("hote.dat", "hotel.dat")





    elif k == "4":

        f2 = open("hotel.dat", "rb")

        while True:

            v = input("ENTER ROOM NO.")

            if len(v) != 0:

                break

            else:

                print("no input found")

                continue

        v = int(v)

        try:

            n = 0

            while True:

                s = pickle.load(f2)

                a = s.room

                if v == a:

                    n = 1

                    print("NAME-", "\t", "\t", s.name)

                    print("\n")

                    print("ADDRESS-", "\t", s.address)

                    print("\n")

                    print("MOBILE NO.-", "  ", s.mobile_no)

                    print("\n")

                    print("HIS TOTAL BILL IS Rs.", s.price)

                elif EOFError:

                    if n == 0:

                        print("NO GUEST IN ROOM ", v)

                else:

                    n = 0

                    continue

        except EOFError:

            pass

        f2.close()

elif k == "5":

        break

else:

        print("invalid choice")

        continue


#! /usr/bin/env python

#  -*- coding: utf-8 -*-

#

# GUI module generated by PAGE version 4.14

# In conjunction with Tcl version 8.6

#    Jul 07, 2018 12:12:02 PM

import os

import pickle

import sys

import os

from subprocess import call


import sys


try:

    from Tkinter import *

except ImportError:

    from tkinter import *


try:

    import ttk

    py3 = False

except ImportError:

    import tkinter.ttk as ttk

    py3 = True

details_list=[]



def file_save():

    NAME_PRO = details_list[0]

    ADDRESS_PRO = details_list[1]

    MOBILE_NO_PRO = details_list[2]

    ROOM_NO_PRO = details_list[3]

    PRICE_PRO = details_list[4]

    f = open("hotel.dat", "ab")

    a=save(NAME_PRO,ADDRESS_PRO,MOBILE_NO_PRO,ROOM_NO_PRO,PRICE_PRO)

    pickle.dump(a,f,protocol=2)

    f.close()

    listq=[str(NAME_PRO),str(ADDRESS_PRO),str(MOBILE_NO_PRO),str(ROOM_NO_PRO),str(PRICE_PRO)]

    myVars = {'A':NAME_PRO,"B":ADDRESS_PRO,"C":MOBILE_NO_PRO,"D":ROOM_NO_PRO,"E":PRICE_PRO }


    fo=open("recipt.txt","w+")

    for h in range(0,5):

        fo.write(listq[h]+"\r\n")

    fo.close()

    call(["python", "recipt.py"])

    restart_program()







u = list()

Delux = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

Semi_Delux = (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)

General = (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)

Joint_Room = (46, 47, 48, 49, 50, 46, 47, 48, 49, 50)

m = [9]

G = []

def restart_program():

    """Restarts the current program.

    Note: this function does not return. Any cleanup action (like

    saving data) must be done before calling this function."""

    python = sys.executable

    os.execl(python, python, * sys.argv)



class save:

    def __init__(self,NAME_PRO,ADDRESS_PRO,MOBILE_NO_PRO,ROOM_NO_PRO,PRICE_PRO):

        self.name=NAME_PRO

        self.address=ADDRESS_PRO

        self.mobile_no=MOBILE_NO_PRO

        self.room_no=ROOM_NO_PRO

        self.price=PRICE_PRO




class HOTEL_MANGMENT_checkin:



    def __init__(self):

        self.NAME=""

        self.ADDERESS=""

        self.MOBILE=""

        self.DAYS=0

        self.price=0

        self.room=0






        def chk_name():

            while True:


                self.k = str(self.name.get())


                a = self.k.isdigit()

                if len(self.k) != 0 and a != True:

                    self.NAME=self.k

                    self.Text1.insert(INSERT, "name has been inputed""\n")

                    break

                else:

                    self.Text1.insert(INSERT, "invalid input please input a valid name""\n")


                    break


        def chk_add():

            while True:

                self.g = str(self.addr.get())



                ak = self.g.isdigit()

                if len(self.g)!= 0 and ak!=True:

                    self.ADDERESS=self.g

                    self.Text1.insert(INSERT, "address has been inputed""\n")

                    break

                else:

                    self.Text1.insert(INSERT, "invalid input please input a valid address""\n")


                    break


        def chk_mo():

            while True:


                self.h = str(self.mobile.get())

                if self.h.isdigit() == True and len(self.h) != 0 and len(self.h) == 10:

                    self.MOBILE = self.h

                    self.Text1.insert(INSERT, "mobile number has been inputed""\n")

                    break

                else:

                    self.Text1.insert(INSERT, "invalid input please input a valid mobile number""\n")

                break


        def chk_day():

            while True:


                self.l = str(self.days.get())


                if self.l.isdigit() == True and len(self.l) != 0:

                    self.DAYS = int(self.l)

                    self.Text1.insert(INSERT, "days has been inputed""\n")

                    break

                else:

                    self.Text1.insert(INSERT, "invalid input ""\n")

                    break


        def enter(self):

            self.name = self.NAME

            self.address = self.ADDERESS

            self.mobile_no = self.MOBILE

            self.no_of_days = int(self.DAYS)


        def tor(self):


            if self.ch == 1:

                self.price = self.price + (2000 * self.no_of_days)

                m[0] = 1

            elif self.ch == 2:

                self.price = self.price + (1500 * self.no_of_days)

                m[0] = 2

            elif self.ch == 3:

                self.price = self.price + (1000 * self.no_of_days)

                m[0] = 3

            elif self.ch == 4:

                self.price = self.price + (1700 * self.no_of_days)

                m[0] = 4


        def payment_option(self):

            op = self.p

            if op == 1:

                self.Text1.insert(INSERT, "no discount""\n")

            elif op == 2:

                self.price = self.price - ((self.price * 10) / 100)

                self.Text1.insert(INSERT, "10% discount""\n")


        def bill(self):


            if m[0] == 1:

                a = Delux

            elif m[0] == 2:

                a = Semi_Delux

            elif m[0] == 3:

                a = General

            elif m[0] == 4:

                a = Joint_Room


            G = []

            f2 = open("hotel.dat", "rb")

            try:

                while True:

                    s = pickle.load(f2)


                    k = s.room_no

                    G.append(k)

                    continue


            except EOFError:

                pass


            for r in a:

                if r not in G:

                    self.room = r

                    break

                else:

                    continue

            self.room = r

            f2.close()


            details_list.append(self.name)

            details_list.append(self.address)

            details_list.append(self.mobile_no)

            details_list.append(self.room)

            details_list.append(self.price)





            file_save()




        def submit_clicked():

            if self.var1.get()==1 and self.var2.get()==0 and self.var3.get()==0 and self.var4.get()==0 and self.var5.get()==1 and self.var6.get()==0:

                self.ch=1

                self.p=2


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)



            elif self.var1.get() == 1 and self.var2.get() == 0 and self.var3.get() == 0 and self.var4.get() == 0 and self.var5.get() == 0 and self.var6.get() == 1:

                self.ch = 1

                self.p = 1


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)

            elif self.var1.get() == 0 and self.var2.get() == 1 and self.var3.get() == 0 and self.var4.get() == 0 and self.var5.get() == 0 and self.var6.get() == 1:

                self.ch = 2

                self.p = 1


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)

            elif self.var1.get() == 0 and self.var2.get() == 1 and self.var3.get() == 0 and self.var4.get() == 0 and self.var5.get() == 1 and self.var6.get() ==0 :

                self.ch = 2

                self.p = 2


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)

            elif self.var1.get() == 0 and self.var2.get() == 0 and self.var3.get() == 1 and self.var4.get() == 0 and self.var5.get() == 0 and self.var6.get() == 1:

                self.ch = 3

                self.p = 1


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)

            elif self.var1.get() == 0 and self.var2.get() == 0 and self.var3.get() == 1 and self.var4.get() == 0 and self.var5.get() == 1 and self.var6.get() == 0:

                self.ch = 3

                self.p = 2


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)


            elif self.var1.get() == 0 and self.var2.get() == 0 and self.var3.get() == 0 and self.var4.get() == 1 and self.var5.get() == 0 and self.var6.get() == 1:

                self.ch = 4

                self.p = 1


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)

            elif self.var1.get() == 0 and self.var2.get() == 0 and self.var3.get() == 0 and self.var4.get() == 1 and self.var5.get() == 1 and self.var6.get() == 0:

                self.ch = 4

                self.p = 2


                enter(self)

                tor(self)

                payment_option(self)

                bill(self)


            else:

                self.Text1.insert(INSERT, "invalid choice please input a valid choice""\n")






        root = Tk()



        '''This class configures and populates the toplevel window.

           top is the toplevel containing window.'''

        _bgcolor = '#ffffff'  # X11 color: 'white'

        _fgcolor = '#000000'  # X11 color: 'black'

        _compcolor = '#ffffff' # X11 color: 'white'

        _ana1color = '#ffffff' # X11 color: 'white'

        _ana2color = '#ffffff' # X11 color: 'white'

        font10 = "-family {Courier New} -size 10 -weight normal -slant"  \

            " roman -underline 0 -overstrike 0"

        font11 = "-family {Segoe UI} -size 30 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font12 = "-family {Segoe UI} -size 18 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font13 = "-family {Segoe UI} -size 17 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font14 = "-family {Segoe UI} -size 16 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font15 = "-family {Segoe UI} -size 19 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font16 = "-family {Segoe UI} -size 15 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font9 = "-family {Segoe UI} -size 9 -weight normal -slant "  \

            "roman -underline 0 -overstrike 0"


        root.geometry("1069x742")

        root.title("HOTEL MANGMENT")

        root.configure(background="#ffffff")

        root.configure(highlightbackground="#ffffff")

        root.configure(highlightcolor="black")


        self.Text1 = Text(root)

        self.Text1.place(relx=0.03, rely=0.65, relheight=0.29, relwidth=0.93)

        self.Text1.configure(background="white")

        self.Text1.configure(font=font9)

        self.Text1.configure(foreground="black")

        self.Text1.configure(highlightbackground="#ffffff")

        self.Text1.configure(highlightcolor="black")

        self.Text1.configure(insertbackground="black")

        self.Text1.configure(selectbackground="#e6e6e6")

        self.Text1.configure(selectforeground="black")

        self.Text1.configure(width=994)

        self.Text1.configure(wrap=WORD)


        self.Frame1 = Frame(root)

        self.Frame1.place(relx=0.03, rely=0.05, relheight=0.12, relwidth=0.93)

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(borderwidth="2")

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(background="#ffffff")

        self.Frame1.configure(highlightbackground="#ffffff")

        self.Frame1.configure(highlightcolor="black")

        self.Frame1.configure(width=995)


        self.Message1 = Message(self.Frame1)

        self.Message1.place(relx=0.04, rely=0.11, relheight=0.84, relwidth=0.5)

        self.Message1.configure(background="#ffffff")

        self.Message1.configure(font=font11)

        self.Message1.configure(foreground="#000000")

        self.Message1.configure(highlightbackground="#ffffff")

        self.Message1.configure(highlightcolor="black")

        self.Message1.configure(text='''YOU CLICKED ON''')

        self.Message1.configure(width=496)


        self.Message2 = Message(self.Frame1)

        self.Message2.place(relx=0.52, rely=0.19, relheight=0.74, relwidth=0.07)

        self.Message2.configure(background="#ffffff")

        self.Message2.configure(font=font11)

        self.Message2.configure(foreground="#000000")

        self.Message2.configure(highlightbackground="#ffffff")

        self.Message2.configure(highlightcolor="black")

        self.Message2.configure(text=''':''')

        self.Message2.configure(width=66)


        self.Message3 = Message(self.Frame1)

        self.Message3.place(relx=0.57, rely=0.11, relheight=0.79, relwidth=0.35)

        self.Message3.configure(background="#ffffff")

        self.Message3.configure(font=font11)

        self.Message3.configure(foreground="#000000")

        self.Message3.configure(highlightbackground="#ffffff")

        self.Message3.configure(highlightcolor="black")

        self.Message3.configure(text='''CHECK INN''')

        self.Message3.configure(width=347)


        self.menubar = Menu(root,font=font9,bg=_bgcolor,fg=_fgcolor)

        root.configure(menu = self.menubar)




        self.Frame2 = Frame(root)

        self.Frame2.place(relx=0.03, rely=0.18, relheight=0.46, relwidth=0.93)

        self.Frame2.configure(relief=GROOVE)

        self.Frame2.configure(borderwidth="2")

        self.Frame2.configure(relief=GROOVE)

        self.Frame2.configure(background="#ffffff")

        self.Frame2.configure(highlightbackground="#ffffff")

        self.Frame2.configure(highlightcolor="black")

        self.Frame2.configure(width=995)


        self.Label3 = Label(self.Frame2)

        self.Label3.place(relx=0.05, rely=0.03, height=47, width=289)

        self.Label3.configure(activebackground="#ffffff")

        self.Label3.configure(activeforeground="black")

        self.Label3.configure(background="#ffffff")

        self.Label3.configure(disabledforeground="#bfbfbf")

        self.Label3.configure(font=font12)

        self.Label3.configure(foreground="#000000")

        self.Label3.configure(highlightbackground="#ffffff")

        self.Label3.configure(highlightcolor="black")

        self.Label3.configure(text='''ENTER YOUR NAME''')


        self.Label4 = Label(self.Frame2)

        self.Label4.place(relx=0.045, rely=0.29, height=47, width=329)

        self.Label4.configure(activebackground="#ffffff")

        self.Label4.configure(activeforeground="black")

        self.Label4.configure(background="#ffffff")

        self.Label4.configure(disabledforeground="#bfbfbf")

        self.Label4.configure(font=font12)

        self.Label4.configure(foreground="#000000")

        self.Label4.configure(highlightbackground="#ffffff")

        self.Label4.configure(highlightcolor="black")

        self.Label4.configure(text='''ENTER YOUR NUMBER''')




        self.Entry3 = Entry(self.Frame2)

        self.name=StringVar()

        self.Entry3.place(relx=0.47, rely=0.05,height=34, relwidth=0.43)

        self.Entry3.configure(background="white")

        self.Entry3.configure(disabledforeground="#bfbfbf")

        self.Entry3.configure(font=font10)

        self.Entry3.configure(foreground="#000000")

        self.Entry3.configure(highlightbackground="#ffffff")

        self.Entry3.configure(highlightcolor="black")

        self.Entry3.configure(insertbackground="black")

        self.Entry3.configure(selectbackground="#e6e6e6")

        self.Entry3.configure(selectforeground="black")

        self.Entry3.configure(textvariable=self.name)



        self.Entry4 = Entry(self.Frame2)

        self.mobile=StringVar()

        self.Entry4.place(relx=0.47, rely=0.31,height=34, relwidth=0.43)

        self.Entry4.configure(background="white")

        self.Entry4.configure(disabledforeground="#bfbfbf")

        self.Entry4.configure(font=font10)

        self.Entry4.configure(foreground="#000000")

        self.Entry4.configure(highlightbackground="#ffffff")

        self.Entry4.configure(highlightcolor="black")

        self.Entry4.configure(insertbackground="black")

        self.Entry4.configure(selectbackground="#e6e6e6")

        self.Entry4.configure(selectforeground="black")

        self.Entry4.configure(textvariable=self.mobile)



        self.Entry5 = Entry(self.Frame2)

        self.addr = StringVar()

        self.Entry5.place(relx=0.47, rely=0.18,height=34, relwidth=0.43)

        self.Entry5.configure(background="white")

        self.Entry5.configure(disabledforeground="#bfbfbf")

        self.Entry5.configure(font=font10)

        self.Entry5.configure(foreground="#000000")

        self.Entry5.configure(highlightbackground="#ffffff")

        self.Entry5.configure(highlightcolor="black")

        self.Entry5.configure(insertbackground="black")

        self.Entry5.configure(selectbackground="#e6e6e6")

        self.Entry5.configure(selectforeground="black")

        self.Entry5.configure(textvariable=self.addr)


        self.Label5 = Label(self.Frame2)

        self.Label5.place(relx=0.045, rely=0.16, height=47, width=334)

        self.Label5.configure(activebackground="#ffffff")

        self.Label5.configure(activeforeground="black")

        self.Label5.configure(background="#ffffff")

        self.Label5.configure(disabledforeground="#bfbfbf")

        self.Label5.configure(font=font12)

        self.Label5.configure(foreground="#000000")

        self.Label5.configure(highlightbackground="#ffffff")

        self.Label5.configure(highlightcolor="black")

        self.Label5.configure(text='''ENTER YOUR ADDRESS''')


        self.Label6 = Label(self.Frame2)

        self.Label6.place(relx=0.32, rely=0.5, height=48, width=296)

        self.Label6.configure(activebackground="#ffffff")

        self.Label6.configure(activeforeground="black")

        self.Label6.configure(background="#ffffff")

        self.Label6.configure(disabledforeground="#bfbfbf")

        self.Label6.configure(font=font13)

        self.Label6.configure(foreground="#000000")

        self.Label6.configure(highlightbackground="#ffffff")

        self.Label6.configure(highlightcolor="black")

        self.Label6.configure(text='''CHOOSE YOUR ROOM''')


        self.Label7 = Label(self.Frame2)

        self.Label7.place(relx=0.3, rely=0.79, height=48, width=300)

        self.Label7.configure(activebackground="#ffffff")

        self.Label7.configure(activeforeground="black")

        self.Label7.configure(background="#ffffff")

        self.Label7.configure(disabledforeground="#bfbfbf")

        self.Label7.configure(font=font14)

        self.Label7.configure(foreground="#000000")

        self.Label7.configure(highlightbackground="#ffffff")

        self.Label7.configure(highlightcolor="black")

        self.Label7.configure(text='''CHOOSE PAYMENT METHOD''')


        self.Message4 = Message(self.Frame2)

        self.Message4.place(relx=0.41, rely=0.04, relheight=0.1, relwidth=0.05)

        self.Message4.configure(background="#ffffff")

        self.Message4.configure(font=font13)

        self.Message4.configure(foreground="#000000")

        self.Message4.configure(highlightbackground="#ffffff")

        self.Message4.configure(highlightcolor="black")

        self.Message4.configure(text=''':''')

        self.Message4.configure(width=46)


        self.Message5 = Message(self.Frame2)

        self.Message5.place(relx=0.42, rely=0.17, relheight=0.12, relwidth=0.03)

        self.Message5.configure(background="#ffffff")

        self.Message5.configure(font=font13)

        self.Message5.configure(foreground="#000000")

        self.Message5.configure(highlightbackground="#ffffff")

        self.Message5.configure(highlightcolor="black")

        self.Message5.configure(text=''':''')

        self.Message5.configure(width=26)


        self.Message6 = Message(self.Frame2)

        self.Message6.place(relx=0.415, rely=0.3, relheight=0.09, relwidth=0.04)

        self.Message6.configure(background="#ffffff")

        self.Message6.configure(font=font13)

        self.Message6.configure(foreground="#000000")

        self.Message6.configure(highlightbackground="#ffffff")

        self.Message6.configure(highlightcolor="black")

        self.Message6.configure(text=''':''')

        self.Message6.configure(width=36)


        self.Checkbutton1 = Checkbutton(self.Frame2)

        self.var1 = IntVar()

        self.Checkbutton1.place(relx=0.15, rely=0.58, relheight=0.17

                , relwidth=0.14)

        self.Checkbutton1.configure(activebackground="#ffffff")

        self.Checkbutton1.configure(activeforeground="#000000")

        self.Checkbutton1.configure(background="#ffffff")

        self.Checkbutton1.configure(disabledforeground="#bfbfbf")

        self.Checkbutton1.configure(font=font14)

        self.Checkbutton1.configure(foreground="#000000")

        self.Checkbutton1.configure(highlightbackground="#ffffff")

        self.Checkbutton1.configure(highlightcolor="black")

        self.Checkbutton1.configure(justify=LEFT)

        self.Checkbutton1.configure(text='''DELUXE''')

        self.Checkbutton1.configure(variable=self.var1)






        self.Checkbutton2 = Checkbutton(self.Frame2)

        self.var2 = IntVar()

        self.Checkbutton2.place(relx=0.15, rely=0.72, relheight=0.11

                , relwidth=0.21)

        self.Checkbutton2.configure(activebackground="#ffffff")

        self.Checkbutton2.configure(activeforeground="#000000")

        self.Checkbutton2.configure(background="#ffffff")

        self.Checkbutton2.configure(disabledforeground="#bfbfbf")

        self.Checkbutton2.configure(font=font13)

        self.Checkbutton2.configure(foreground="#000000")

        self.Checkbutton2.configure(highlightbackground="#ffffff")

        self.Checkbutton2.configure(highlightcolor="black")

        self.Checkbutton2.configure(justify=LEFT)

        self.Checkbutton2.configure(text='''FULL DELUXE''')

        self.Checkbutton2.configure(variable=self.var2)


        self.Checkbutton3 = Checkbutton(self.Frame2)

        self.var3 = IntVar()

        self.Checkbutton3.place(relx=0.5, rely=0.6, relheight=0.11

                , relwidth=0.16)

        self.Checkbutton3.configure(activebackground="#ffffff")

        self.Checkbutton3.configure(activeforeground="#000000")

        self.Checkbutton3.configure(background="#ffffff")

        self.Checkbutton3.configure(disabledforeground="#bfbfbf")

        self.Checkbutton3.configure(font=font13)

        self.Checkbutton3.configure(foreground="#000000")

        self.Checkbutton3.configure(highlightbackground="#ffffff")

        self.Checkbutton3.configure(highlightcolor="black")

        self.Checkbutton3.configure(justify=LEFT)

        self.Checkbutton3.configure(text='''GENERAL''')

        self.Checkbutton3.configure(variable=self.var3)


        self.Checkbutton4 = Checkbutton(self.Frame2)

        self.var4 = IntVar()

        self.Checkbutton4.place(relx=0.5, rely=0.71, relheight=0.11

                , relwidth=0.12)

        self.Checkbutton4.configure(activebackground="#ffffff")

        self.Checkbutton4.configure(activeforeground="#000000")

        self.Checkbutton4.configure(background="#ffffff")

        self.Checkbutton4.configure(disabledforeground="#bfbfbf")

        self.Checkbutton4.configure(font=font13)

        self.Checkbutton4.configure(foreground="#000000")

        self.Checkbutton4.configure(highlightbackground="#ffffff")

        self.Checkbutton4.configure(highlightcolor="black")

        self.Checkbutton4.configure(justify=LEFT)

        self.Checkbutton4.configure(text='''JOINT''')

        self.Checkbutton4.configure(variable=self.var4)


        self.Checkbutton5 = Checkbutton(self.Frame2)

        self.var5 = IntVar()

        self.Checkbutton5.place(relx=0.485, rely=0.89, relheight=0.1

                                , relwidth=0.3)

        self.Checkbutton5.configure(activebackground="#ffffff")

        self.Checkbutton5.configure(activeforeground="#000000")

        self.Checkbutton5.configure(background="#ffffff")

        self.Checkbutton5.configure(disabledforeground="#bfbfbf")

        self.Checkbutton5.configure(font=font16)

        self.Checkbutton5.configure(foreground="#000000")

        self.Checkbutton5.configure(highlightbackground="#ffffff")

        self.Checkbutton5.configure(highlightcolor="black")

        self.Checkbutton5.configure(justify=LEFT)

        self.Checkbutton5.configure(text='''By credit/debit card''')

        self.Checkbutton5.configure(variable=self.var5)


        self.Checkbutton6 = Checkbutton(self.Frame2)

        self.var6 = IntVar()

        self.Checkbutton6.place(relx=0.153, rely=0.89, relheight=0.1

                                , relwidth=0.15)

        self.Checkbutton6.configure(activebackground="#ffffff")

        self.Checkbutton6.configure(activeforeground="#000000")

        self.Checkbutton6.configure(background="#ffffff")

        self.Checkbutton6.configure(disabledforeground="#bfbfbf")

        self.Checkbutton6.configure(font=font16)

        self.Checkbutton6.configure(foreground="#000000")

        self.Checkbutton6.configure(highlightbackground="#ffffff")

        self.Checkbutton6.configure(highlightcolor="black")

        self.Checkbutton6.configure(justify=LEFT)

        self.Checkbutton6.configure(text='''By cash''')

        self.Checkbutton6.configure(variable=self.var6)


        self.Message7 = Message(self.Frame2)

        self.Message7.place(relx=0.28, rely=0.46, relheight=0.11, relwidth=0.04)

        self.Message7.configure(background="#ffffff")

        self.Message7.configure(font=font15)

        self.Message7.configure(foreground="#000000")

        self.Message7.configure(highlightbackground="#ffffff")

        self.Message7.configure(highlightcolor="black")

        self.Message7.configure(text='''-''')

        self.Message7.configure(width=41)


        self.Button1 = Button(self.Frame2)

        self.Button1.place(relx=0.91, rely=0.05, height=33, width=43)

        self.Button1.configure(activebackground="#ffffff")

        self.Button1.configure(activeforeground="#000000")

        self.Button1.configure(background="#ffffff")

        self.Button1.configure(disabledforeground="#bfbfbf")

        self.Button1.configure(foreground="#000000")

        self.Button1.configure(highlightbackground="#ffffff")

        self.Button1.configure(highlightcolor="black")

        self.Button1.configure(pady="0")

        self.Button1.configure(text='''OK''')

        self.Button1.configure(command=chk_name)


        self.Button2 = Button(self.Frame2)

        self.Button2.place(relx=0.91, rely=0.18, height=33, width=43)

        self.Button2.configure(activebackground="#ffffff")

        self.Button2.configure(activeforeground="#000000")

        self.Button2.configure(background="#ffffff")

        self.Button2.configure(disabledforeground="#bfbfbf")

        self.Button2.configure(foreground="#000000")

        self.Button2.configure(highlightbackground="#ffffff")

        self.Button2.configure(highlightcolor="black")

        self.Button2.configure(pady="0")

        self.Button2.configure(text='''OK''')

        self.Button2.configure(command=chk_add)


        self.Button3 = Button(self.Frame2)

        self.Button3.place(relx=0.91, rely=0.31, height=33, width=43)

        self.Button3.configure(activebackground="#ffffff")

        self.Button3.configure(activeforeground="#000000")

        self.Button3.configure(background="#ffffff")

        self.Button3.configure(disabledforeground="#bfbfbf")

        self.Button3.configure(foreground="#000000")

        self.Button3.configure(highlightbackground="#ffffff")

        self.Button3.configure(highlightcolor="black")

        self.Button3.configure(pady="0")

        self.Button3.configure(text='''OK''')

        self.Button3.configure(command=chk_mo)


        self.Button4 = Button(self.Frame2)

        self.Button4.place(relx=0.76, rely=0.66, height=83, width=156)

        self.Button4.configure(activebackground="#ffffff")

        self.Button4.configure(activeforeground="#000000")

        self.Button4.configure(background="#ffffff")

        self.Button4.configure(disabledforeground="#bfbfbf")

        self.Button4.configure(font=font16)

        self.Button4.configure(foreground="#000000")

        self.Button4.configure(highlightbackground="#ffffff")

        self.Button4.configure(highlightcolor="black")

        self.Button4.configure(pady="0")

        self.Button4.configure(text='''SUBMIT''')

        self.Button4.configure(command=submit_clicked)


        self.Label1 = Label(self.Frame2)

        self.Label1.place(relx=0.05, rely=0.43, height=44, width=260)

        self.Label1.configure(background="#ffffff")

        self.Label1.configure(disabledforeground="#bfbfbf")

        self.Label1.configure(font=font13)

        self.Label1.configure(foreground="#000000")

        self.Label1.configure(text='''NUMBER OF DAYS''')



        self.Entry1 = Entry(self.Frame2)

        self.days=StringVar()

        self.Entry1.place(relx=0.47, rely=0.43, height=34, relwidth=0.43)

        self.Entry1.configure(background="white")

        self.Entry1.configure(disabledforeground="#bfbfbf")

        self.Entry1.configure(font=font10)

        self.Entry1.configure(foreground="#000000")

        self.Entry1.configure(insertbackground="black")

        self.Entry1.configure(width=424)

        self.Entry1.configure(textvariable=self.days)


        self.Message8 = Message(self.Frame2)

        self.Message8.place(relx=0.42, rely=0.41, relheight=0.11, relwidth=0.03)

        self.Message8.configure(background="#ffffff")

        self.Message8.configure(font=font13)

        self.Message8.configure(foreground="#000000")

        self.Message8.configure(highlightbackground="#ffffff")

        self.Message8.configure(highlightcolor="black")

        self.Message8.configure(text=''':''')

        self.Message8.configure(width=26)


        self.Button5 = Button(self.Frame2)

        self.Button5.place(relx=0.91, rely=0.43, height=33, width=43)

        self.Button5.configure(activebackground="#ffffff")

        self.Button5.configure(activeforeground="#000000")

        self.Button5.configure(background="#ffffff")

        self.Button5.configure(disabledforeground="#bfbfbf")

        self.Button5.configure(foreground="#000000")

        self.Button5.configure(highlightbackground="#ffffff")

        self.Button5.configure(highlightcolor="black")

        self.Button5.configure(pady="0")

        self.Button5.configure(text='''OK''')

        self.Button5.configure(command=chk_day)



        root.mainloop()



if __name__ == '__main__':

    hotel=HOTEL_MANGMENT_checkin()


import os

import pickle


details_list=[]

l2=[]

G = []

def file_save():

    NAME_PRO = details_list[0]

    ADDRESS_PRO = details_list[1]

    MOBILE_NO_PRO = details_list[2]

    ROOM_NO_PRO = details_list[3]

    PRICE_PRO = details_list[4]

    f = open("hotel.dat", "ab")

    a=save(NAME_PRO,ADDRESS_PRO,MOBILE_NO_PRO,ROOM_NO_PRO,PRICE_PRO)

    pickle.dump(a,f,protocol=2)

    f.close()

    restart_program()



def restart_program():

    """Restarts the current program.

    Note: this function does not return. Any cleanup action (like

    saving data) must be done before calling this function."""

    python = sys.executable

    os.execl(python, python, * sys.argv)







class save:

    def __init__(self, NAME_PRO, ADDRESS_PRO, MOBILE_NO_PRO, ROOM_NO_PRO, PRICE_PRO):

        self.name=NAME_PRO

        self.address=ADDRESS_PRO

        self.mobile_no=MOBILE_NO_PRO

        self.room_no=ROOM_NO_PRO

        self.price=PRICE_PRO

        print(self.name,self.address,self.mobile_no,self.room_no,self.price)


import sys


try:

    from Tkinter import *

except ImportError:

    from tkinter import *


try:

    import ttk

    py3 = False

except ImportError:

    import tkinter.ttk as ttk

    py3 = True



class HOTEL_MANAGEMENT:

    def __init__(self):

        def gotinfo():

            self.gettininfo = str(self.gather.get())

            print(self.gettininfo)

            print("\n")

            if self.gettininfo.isdigit() == True and len(self.gettininfo) != 0:

                self.Text1.insert(INSERT, " valid room number ""\n")

            else :

                self.Text1.insert(INSERT,"invalid room number""\n")


            try:

                n = 0

                f2 = open("hotel.dat", "rb")

                while True:

                    s = pickle.load(f2)

                    a = str(s.room_no)

                    print (a)

                    if self.gettininfo == a:

                        n = 1

                        print("NAME-", "\t", "\t", s.name)

                        print("\n")

                        print("ADDRESS-", "\t", s.address)

                        print("\n")

                        print("MOBILE NO.-", "  ", s.mobile_no)

                        print("\n")

                        print("HIS TOTAL BILL IS Rs.", s.price)

                    elif EOFError:

                        if n == 0:

                            print("NO GUEST IN ROOM ", self.gettininfo)

                        else:

                            n = 0

                            continue

            except EOFError:

                pass

                f2.close()


        root = Tk()

        '''This class configures and populates the toplevel window.

           top is the toplevel containing window.'''

        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'

        _fgcolor = '#000000'  # X11 color: 'black'

        _compcolor = '#d9d9d9' # X11 color: 'gray85'

        _ana1color = '#d9d9d9' # X11 color: 'gray85'

        _ana2color = '#d9d9d9' # X11 color: 'gray85'

        font10 = "-family {Segoe UI} -size 17 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font11 = "-family {Segoe UI} -size 28 -weight bold -slant "  \

            "roman -underline 0 -overstrike 0"

        font9 = "-family {Segoe UI} -size 23 -weight bold -slant roman"  \

            " -underline 0 -overstrike 0"


        root.geometry("881x582+249+104")

        root.title("HOTEL MANAGEMENT")

        root.configure(background="#d9d9d9")




        self.Frame1 = Frame(root)

        self.Frame1.place(relx=0.02, rely=0.03, relheight=0.94, relwidth=0.94)

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(borderwidth="2")

        self.Frame1.configure(relief=GROOVE)

        self.Frame1.configure(background="#d9d9d9")

        self.Frame1.configure(width=825)


        self.Text1 = Text(self.Frame1)

        self.Text1.place(relx=0.04, rely=0.46, relheight=0.48, relwidth=0.93)

        self.Text1.configure(background="white")

        self.Text1.configure(font="TkTextFont")

        self.Text1.configure(foreground="black")

        self.Text1.configure(highlightbackground="#d9d9d9")

        self.Text1.configure(highlightcolor="black")

        self.Text1.configure(insertbackground="black")

        self.Text1.configure(selectbackground="#c4c4c4")

        self.Text1.configure(selectforeground="black")

        self.Text1.configure(width=764)

        self.Text1.configure(wrap=WORD)




        self.Label1 = Label(self.Frame1)

        self.Label1.place(relx=0.12, rely=0.15, height=48, width=377)

        self.Label1.configure(background="#d9d9d9")

        self.Label1.configure(disabledforeground="#a3a3a3")

        self.Label1.configure(font=font9)

        self.Label1.configure(foreground="#000000")

        self.Label1.configure(text='''ENTER THE ROOM NO.   :''')


        self.Entry1 = Entry(self.Frame1)

        self.gather=StringVar()

        self.Entry1.place(relx=0.65, rely=0.17,height=40, relwidth=0.1)

        self.Entry1.configure(background="white")

        self.Entry1.configure(disabledforeground="#a3a3a3")

        self.Entry1.configure(font="TkFixedFont")

        self.Entry1.configure(foreground="#000000")

        self.Entry1.configure(insertbackground="black")

        self.Entry1.configure(width=84)

        self.Entry1.configure(textvariable=self.gather)


        self.Button1 = Button(self.Frame1)

        self.Button1.place(relx=0.39, rely=0.29, height=74, width=197)

        self.Button1.configure(activebackground="#d9d9d9")

        self.Button1.configure(activeforeground="#000000")

        self.Button1.configure(background="#d9d9d9")

        self.Button1.configure(disabledforeground="#a3a3a3")

        self.Button1.configure(font=font10)

        self.Button1.configure(foreground="#000000")

        self.Button1.configure(highlightbackground="#d9d9d9")

        self.Button1.configure(highlightcolor="black")

        self.Button1.configure(pady="0")

        self.Button1.configure(text='''SUBMIT''')

        self.Button1.configure(width=197)

        self.Button1.configure(command=gotinfo)


        self.Message1 = Message(self.Frame1)

        self.Message1.place(relx=0.22, rely=0.02, relheight=0.12, relwidth=0.56)

        self.Message1.configure(background="#d9d9d9")

        self.Message1.configure(font=font11)

        self.Message1.configure(foreground="#000000")

        self.Message1.configure(highlightbackground="#d9d9d9")

        self.Message1.configure(highlightcolor="black")

        self.Message1.configure(text='''GET INFO HERE ..!!''')

        self.Message1.configure(width=460)

        root.mainloop()







if __name__ == '__main__':

    GETINFO=HOTEL_MANAGEMENT()


import os
import pickle

details_list=[]
l2=[]
G = []
def file_save():
    NAME_PRO = details_list[0]
    ADDRESS_PRO = details_list[1]
    MOBILE_NO_PRO = details_list[2]
    ROOM_NO_PRO = details_list[3]
    PRICE_PRO = details_list[4]
    f = open("hotel.dat", "ab")
    a=save(NAME_PRO,ADDRESS_PRO,MOBILE_NO_PRO,ROOM_NO_PRO,PRICE_PRO)
    pickle.dump(a,f,protocol=2)
    f.close()
    restart_program()


def restart_program():
    """Restarts the current program.
    Note: this function does not return. Any cleanup action (like
    saving data) must be done before calling this function."""
    python = sys.executable
    os.execl(python, python, * sys.argv)






class save:
    def __init__(self, NAME_PRO, ADDRESS_PRO, MOBILE_NO_PRO, ROOM_NO_PRO, PRICE_PRO):
        self.name=NAME_PRO
        self.address=ADDRESS_PRO
        self.mobile_no=MOBILE_NO_PRO
        self.room_no=ROOM_NO_PRO
        self.price=PRICE_PRO
        print(self.name,self.address,self.mobile_no,self.room_no,self.price)





import sys

try:
    from Tkinter import *
except ImportError:
    from tkinter import *

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True



class New_Toplevel:

    def __init__(self):
        def check_room():
            self.rom = str(self.data.get())
            print(self.rom)
            print("\n")
            if self.rom.isdigit() == True and len(self.rom) != 0:
                self.Text1.insert(INSERT, " valid room number ""\n")
                v = int(self.rom)
                f = open("hotel.dat", "rb")
                f1 = open("hote.dat", "ab")
                n = 0
                try:
                    while True:
                        s = pickle.load(f)
                        if s.room_no == v:
                            n = 1
                            name1 = s.name

                            print(" ")
                        else:
                            pickle.dump(s, f1)
                except EOFError:
                    if n == 0:
                        self.Text1.insert(INSERT, "NO GUEST FOUND""\n")

                    elif n == 1:

                        self.Text1.insert(INSERT, "THANK YOU  " + name1.upper() + " FOR VISTING US""\n")
                    pass
                f.close()
                f1.close()
                os.remove("hotel.dat")
                os.rename("hote.dat", "hotel.dat")

            else:
                self.Text1.insert(INSERT, "invalid input please input a valid ROOM NO.""\n")

        root = Tk()
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#ffffff'  # X11 color: 'white'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#ffffff' # X11 color: 'white'
        _ana1color = '#ffffff' # X11 color: 'white'
        _ana2color = '#ffffff' # X11 color: 'white'
        font10 = "-family {Courier New} -size 10 -weight normal -slant"  \
            " roman -underline 0 -overstrike 0"
        font11 = "-family {Segoe UI} -size 23 -weight bold -slant "  \
            "roman -underline 0 -overstrike 0"
        font12 = "-family {Segoe UI} -size 24 -weight bold -slant "  \
            "roman -underline 0 -overstrike 0"
        font9 = "-family {Segoe UI} -size 9 -weight normal -slant "  \
            "roman -underline 0 -overstrike 0"

        root.geometry("1011x750")
        root.title("HOTEL MANAGEMENT")
        root.configure(background="#ffffff")
        root.configure(highlightbackground="#ffffff")
        root.configure(highlightcolor="black")



        self.Frame1 = Frame(root)
        self.Frame1.place(relx=0.04, rely=0.04, relheight=0.91, relwidth=0.91)
        self.Frame1.configure(relief=GROOVE)
        self.Frame1.configure(borderwidth="2")
        self.Frame1.configure(relief=GROOVE)
        self.Frame1.configure(background="#ffffff")
        self.Frame1.configure(highlightbackground="#ffffff")
        self.Frame1.configure(highlightcolor="black")
        self.Frame1.configure(width=925)

        self.Label1 = Label(self.Frame1)
        self.Label1.place(relx=0.14, rely=0.12, height=46, width=442)
        self.Label1.configure(activebackground="#ffffff")
        self.Label1.configure(activeforeground="black")
        self.Label1.configure(background="#ffffff")
        self.Label1.configure(disabledforeground="#bfbfbf")
        self.Label1.configure(font=font11)
        self.Label1.configure(foreground="#000000")
        self.Label1.configure(highlightbackground="#ffffff")
        self.Label1.configure(highlightcolor="black")
        self.Label1.configure(text='''ENTER THE ROOM NO.   :''')

        self.Entry1 = Entry(self.Frame1)
        self.data=StringVar()
        self.Entry1.place(relx=0.67, rely=0.12,height=44, relwidth=0.07)
        self.Entry1.configure(background="white")
        self.Entry1.configure(disabledforeground="#bfbfbf")
        self.Entry1.configure(font=font10)
        self.Entry1.configure(foreground="#000000")
        self.Entry1.configure(highlightbackground="#ffffff")
        self.Entry1.configure(highlightcolor="black")
        self.Entry1.configure(insertbackground="black")
        self.Entry1.configure(selectbackground="#e6e6e6")
        self.Entry1.configure(selectforeground="black")
        self.Entry1.configure(textvariable=self.data)







        self.Text1 = Text(self.Frame1)
        self.Text1.place(relx=0.05, rely=0.54, relheight=0.4, relwidth=0.89)
        self.Text1.configure(background="white")
        self.Text1.configure(font=font9)
        self.Text1.configure(foreground="black")
        self.Text1.configure(highlightbackground="#ffffff")
        self.Text1.configure(highlightcolor="black")
        self.Text1.configure(insertbackground="black")
        self.Text1.configure(selectbackground="#e6e6e6")
        self.Text1.configure(selectforeground="black")
        self.Text1.configure(width=824)
        self.Text1.configure(wrap=WORD)

        self.Button1 = Button(self.Frame1)
        self.Button1.place(relx=0.34, rely=0.28, height=93, width=286)
        self.Button1.configure(activebackground="#ffffff")
        self.Button1.configure(activeforeground="#000000")
        self.Button1.configure(background="#ffffff")
        self.Button1.configure(disabledforeground="#bfbfbf")
        self.Button1.configure(font=font12)
        self.Button1.configure(foreground="#000000")
        self.Button1.configure(highlightbackground="#ffffff")
        self.Button1.configure(highlightcolor="black")
        self.Button1.configure(pady="0")
        self.Button1.configure(text='''CHECK OUT''')
        self.Button1.configure(command=check_room)
        root.mainloop()



if __name__ == '__main__':
    out=New_Toplevel()

from __main__ import *

import sys


try:

    from Tkinter import *

except ImportError:

    from tkinter import *


try:

    import ttk

    py3 = False

except ImportError:

    import tkinter.ttk as ttk

    py3 = True


fo1=open("recipt.txt","r")

list1=fo1.readlines()


del list1[1]

del list1[2]

del list1[3]

del list1[4]

del list1[5]

list1[0]=list1[0][:-1]

list1[1]=list1[1][:-1]

list1[2]=list1[2][:-1]

list1[3]=list1[3][:-1]

list1[4]=list1[4][:-1]


p='''

@@@@@@@@@@@  PROJECTWORLDS HOTEL AND RESORTS  @@@@@@@@@@@@@

@@@@@@@@@@@@ BHILAI CHHATTISGARH@@@@@@@@@@@@@@

@@@@@@@@@@ SERVING    GUEST   SINCE @@@@@@@@@@@@@@@@@

@@@@@@@@@@@@@@@    ###2000###       @@@@@@@@@@@@@@@@@

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

NAME-%s

ADDRESS-%s

MOBILE NO.-%s

YOUR TOTAL BILL IS Rs.-%s

YOUR ROOM NUMBER IS %s    

     

     

     

'''%(list1[0],list1[1],list1[2],list1[4],list1[3])


        






class recipt:

    def __init__(self):

        root=Tk()

        '''This class configures and populates the toplevel window.

           top is the toplevel containing window.'''

        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'

        _fgcolor = '#000000'  # X11 color: 'black'

        _compcolor = '#d9d9d9' # X11 color: 'gray85'

        _ana1color = '#d9d9d9' # X11 color: 'gray85'

        _ana2color = '#d9d9d9' # X11 color: 'gray85'


        root.geometry("800x800")

        root.title("recipt")

        root.configure(background="#d9d9d9")




        self.Label1 = Label(root)

        self.Label1.configure(background="#d9d9d9")

        self.Label1.place(relx=0, rely=0, height=800, width=800)

        self.Label1.configure(disabledforeground="#a3a3a3")

        self.Label1.configure(foreground="#000000")

        self.Label1.configure(text=p)

        self.Label1.configure(anchor=N)


        self.Label1.configure(wraplength=1000)

        self.Label1.configure(justify =LEFT)


        self.Label1.configure(width=582)

        root.mainloop()



if __name__ == '__main__':

    recipt1=recipt()


OUTPUTS













Comments

Followers

Popular posts from this blog

HOSTEL MANAGEMENT SYSTEM BY PYTHON

SCREENSHOT USING PYTHON

Contact form

Name

Email *

Message *