from tkinter import *
pencere = Tk()
pencere.title("depo durumu")
pencere.geometry("800x500+250+50")
pencere.resizable(FALSE,FALSE)
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
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.30 , relx=0.13)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.30 , relx=0.009)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.35 , relx=0.13)
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.13)
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.13)
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.13)
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.13)
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.48)
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.48)
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.48)
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.48)
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.48)
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.48)
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.83)
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.83)
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.83)
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.83)
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.83)
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.83)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.85 , relx=0.701)
#####sipariş butonu
def yeniPencereEkle():
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()
siparis1=Button(text="SİPARİŞ", command=yeniPencereEkle)
siparis1.pack()
siparis1.place(rely=0.95 , relx=0.9)
####kaydet
siparis1=Button(text="KAYDET", command=open)
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()
pencere.mainloop()
arkadaşlar burdan aldıgımız tüm verileri dosyaya kayıt etmem ve lazım oldugunda yerlerine geri getirmem lazım üniversite 1. sınıf öğrencisiyim projemiz bu yardım ederseniz çok mutlu olurum
yazdıramka istediğin dosya ne excel,txt …?
Lütfen kodlarınıza kod görünümü kazandırmak için aşağıdaki talimatları uygulayın.
siparişlerimi yazdırmak istiyorsun ne istediğini biraz daha açık yaar mısın ?
uygulamada 2 çeşit olmak üzere veri girebildigimiz entryler var bunlara yazılan verileri dosyaya kaydetmek istiyorum ama bir türlü beceremedim @vursace
from tkinter import *
class Depo:
def __init__(self,pencere):
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.13)
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.13)
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.13)
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.13)
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.13)
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.13)
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.48)
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.48)
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.48)
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.48)
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.48)
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.48)
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.83)
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.83)
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.83)
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.83)
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.83)
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.83)
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('stok1.txt','w')
dosya.write('{}'.format(self.giris1.get()))
pencere=Tk()
uygulama=Depo(pencere)
pencere.mainloop()
Bu gibi projeler için nesne tabanlı programlama yapmanda fayda var,ben az çok toparladım gerisini sana bırakıyorum
çok sağol işime yaradı
Traceback (most recent call last):
File “C:\Users\bicer\AppData\Local\Programs\Python\Python37\Lib\tkinter_init_.py”, line 1705, in call
return self.func(*args)
File “”, line 218, in Kayit
TypeError: open() takes 0 positional arguments but 2 were given
@vursace yine aynı hatayı veriyor kafa atıcam bilgisayara
dosya=open(‘stok1.txt’,‘w’)
ilk tırnak içine dosyanın kaydedileceği url’yi yaz…
dosya=open(‘C:\prj/ad.txt’,‘w’) bu halde yazdım zaten dosya burda açık
\
karakterini kaçırmanız lazım:
dosya = open('C:\\prj/ad.txt', 'w')