Python tkinter şifreleme ekranı(yardım ederseniz sevinirim)

merhaba bu koda bir giriş ekranı eklemeye çalışıyorum 1-2 saatir fakat beceremedim (kullanıcı adı şifre soracak ve ekran kaybolacak bu kod açılacak ) yardımcı olursanız sevinirim


from tkinter import *

class Depo:

    def __init__(self,pencere):          #### sınıf örneğinin kullanıma hazır olması için gereken tüm işlemler _init_() metodu içerisinde yapılır

        self.pencere=pencere

        self.pencere.title("depo durumu")

        self.pencere.geometry("800x500+250+50")

        self.pencere.resizable(FALSE,FALSE)

        self.pencere.configure (background="grey" )

        #################

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.25 ) # relheight kalınlık ,width uzunluk , rely y ekseninde harakter

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.50 )

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.75 )

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.99 )

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.75 , relwidth =0.007 , relx=0.34 , rely=0.25 )

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.75 , relwidth =0.007 , relx=0.68 , rely=0.25 )

        ####raf1

        cizgi = Button(bg="white",text="1.RAF" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.23 , relx=0.136)

        ###1.1

        self.giris1 =Entry()

        self.giris1.pack()

        self.giris1.place(relheight=0.04 , rely=0.30 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.30 , relx=0.009)

        self.giris2 =Entry()

        self.giris2.pack()

        self.giris2.place(relheight=0.04 , rely=0.35 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.35 , relx=0.001)

        ###1.2

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.55 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.55 , relx=0.009)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.60 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.60 , relx=0.001)

        ###1.3

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.80 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.80 , relx=0.009)

        giris1 =Entry()

        giris1.pack()

        giris1.place(relheight=0.04 , rely=0.85 , relx=0.15)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.85 , relx=0.001)

        ####2.raf

        cizgi = Button(bg="white",text="2.RAF" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.23 , relx=0.472)

        ###2.1

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.30 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.30 , relx=0.359)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.35 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.35 , relx=0.351)

        ###2.2

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.55 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.55 , relx=0.359)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.60 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.60 , relx=0.351)

        ###2.3

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.80 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.80 , relx=0.359)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.85 , relx=0.50)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.85 , relx=0.351)

        ###3.RAF

        cizgi = Button(bg="white",text="3.RAF" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.23 , relx=0.802)

        ###3.1

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.30 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.30 , relx=0.709)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.35 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.35 , relx=0.701)

        ###3.2

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.55 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.55 , relx=0.709)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.60 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.60 , relx=0.701)

        ###3.3

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.80 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.80 , relx=0.709)

        giris =Entry()

        giris.pack()

        giris.place(relheight=0.04 , rely=0.85 , relx=0.85)

        cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )

        cizgi.pack()

        cizgi.place(rely=0.85 , relx=0.701)

        siparis1 = Button(text="SİPARİŞ", command=self.yeniPencereEkle)

        siparis1.pack()

        siparis1.place(rely=0.95, relx=0.9)

        ####kaydet

        siparis1 = Button(text="KAYDET",command=self.Kayit)

        siparis1.pack()

        siparis1.place(rely=0.95, relx=0.83)

        ##başlık

        yazı = Label(text="ÜNÇA YEDEK PARÇA DEPOSU", fg="yellow", bg="black", font=("Open Sans", "17", "bold"))

        yazı.pack()

    def yeniPencereEkle(self):

        yeniPencere = Toplevel()

        siparis = Button(yeniPencere , text="GELİŞ SÜRELERİ\nÇiviler=1gün\nbobin=5gün\nconta=4gün\nCıvatalar=2gün\nRulman=4gün\nsipariş vermek için 04441911 nolu numarayı arayabilirsiniz" ,command=yeniPencere.destroy, bg="white", state="disabled")

        siparis.pack()

    def Kayit(self):

        dosya = open("C:\prj/raf2.txt","w")

        dosya.write("{}".format(self.giris1.get()))

pencere=Tk()

uygulama=Depo(pencere)

pencere.mainloop,

bu kodla birleştirmeye çalışıyorum

from tkinter import *

pencere=Tk()
pencere.title("coderlife")
pencere.geometry("200x100")


def ana():
    mesaj=Label(text="Bilgiler Doğru\nSisteme Giriş Yapıldı")
    mesaj.pack()
   
def kontrol():
    kont_ad=str(ad.get()) # get ile kutu içindeki bilgiler alınır
    kont_sifre=str(sifre.get())

    if kont_ad==u"admin" and kont_sifre==u"sifre": # alınan bilgiler doğru ise
        kul_adi.destroy() # destroy() nesneleri yok eder
        kul_sifre.destroy()
        ad.destroy()
        sifre.destroy()
        buton.destroy()

        # hepsini temizledik. şimdi ana fonksiyona geçelim
        ana()
       
    else: # doğru değil ise tepki verme
        pass


def giris():
    global ad,sifre,kul_adi,kul_sifre,buton # diğer fonksiyonlarda kullanabilmek için global yaptık
   
    kul_adi=Label(text="Kullanıcı Adı")
    kul_adi.grid(row=0,column=0)
   
    kul_sifre=Label(text="Şifre")
    kul_sifre.grid(row=1,column=0)

    ad=Entry()
    ad.grid(row=0,column=1)

    sifre=Entry()
    sifre.grid(row=1,column=1)

    buton=Button(text="Giriş",command=kontrol) # tıklandığı zaman kontrol() fonksiyonu çağrılır
    buton.grid(row=2,column=1)


giris() # program buradan başlıyor

mainloop()

Aşağıdaki bağlantıyı ziyaret ederek kodlarınıza nasıl kod görünümü verebileceğinizi öğrenebilirsiniz.

Yanlış anlamayın ama defalarca aynı değişken ismiyle farklı widgetler tanımlamışsınız. Kodlar maalesef çok kötü yazılmış. :confused:

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.25 ) # relheight kalınlık ,width uzunluk , rely y ekseninde harakter

        cizgi = Label(bg="black")

        cizgi.pack()

        cizgi.place(relheight=0.01 , relwidth =800 , rely=0.50 )

        cizgi = Label(bg="black")

        cizgi.pack()

İlk kodları çalıştırmaya çalışırken şöyle bir hata aldım:

X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Serial number of failed request:  955
  Current serial number in output stream:  1154
``