Erstellt als einfache grobe Schätzung. Der schlampige Code ist zu lang und wird in Zukunft behoben. Wir planen, die Konvertierung in PDF in Zukunft in Frage zu stellen.
import tkinter as tk
def callBackFunc():
global a
global a1
a=str('Produkt 1')
a1=10000000
def callBackFunc1():
global a,a1
a=str('Produkt 2')
a1=20000000
def callBackFunc2():
global a,a1
a=str('Produkt 3')
a1=8000000
def callBackFunc3():
global b,b1
b=str('2 Wellenlängen')
b1=5000000
def callBackFunc4():
global b,b1
b=str('3 Wellenlängen')
b1=6500000
def callBackFunc5():
global b,b1
b=str('4 Wellenlängen')
b1=7500000
app = tk.Tk()
app.geometry('300x200')
#-------------CSU-Bildschirm------------
#Erstellen Sie 2 Kontrollkästchen
chkValue = tk.BooleanVar()
chkValue.set(False)
chkValue1 = tk.BooleanVar()
chkValue1.set(False)
chkValue2 = tk.BooleanVar()
chkValue2.set(False)
#3 Kontrollkästchen Text
chkExample = tk.Checkbutton(app, text='CSUW1',
var=chkValue, command=callBackFunc)
chkExample1 = tk.Checkbutton(app, text='CSUW1SoRa',
var=chkValue1, command=callBackFunc1)
chkExample2 = tk.Checkbutton(app, text='CSUX1',
var=chkValue2, command=callBackFunc2)
#Setzen Sie 2 Kontrollkästchen
chkExample.place(x=30, y=30)
chkExample1.place(x=30, y=50)
chkExample2.place(x=30, y=70)
frame1=tk.Frame()
frame1.place(x=30,y=100)
#Taste, um von Bild 1 zum Hauptbild zurückzukehren
back_button = tk.Button(frame1, text="Laser-", command=changePage)
back_button.pack()
#----------Laserschirm----------------------
def changePage():
frame2=tk.Frame()
frame2.place(x=30,y=100)
back_button = tk.Button(frame2, text="Schätzungen", command=changePage1)
back_button.pack()
#Erstellen Sie 2 Kontrollkästchen
chkValue3 = tk.BooleanVar()
chkValue3.set(False)
chkValue4 = tk.BooleanVar()
chkValue4.set(False)
chkValue5 = tk.BooleanVar()
chkValue5.set(False)
#3 Kontrollkästchen Text
chkExample3 = tk.Checkbutton(app, text='2 Wellenlängen',
var=chkValue3, command=callBackFunc3)
chkExample4 = tk.Checkbutton(app, text='3 Wellenlängen',
var=chkValue4, command=callBackFunc4)
chkExample5 = tk.Checkbutton(app, text='4 Wellenlängen',
var=chkValue5, command=callBackFunc5)
#Setzen Sie 2 Kontrollkästchen
chkExample3.place(x=30, y=30)
chkExample4.place(x=30, y=50)
chkExample5.place(x=30, y=70)
#-----------Bildschirm schätzen---------------------
def changePage1():
app1 = tk.Tk()
app1.geometry('500x300')
app1.title('Ungefähre Schätzung')
lbl=tk.Label(app1,text='Ungefähre Schätzung')
lbl.place(x=30,y=50)
txt=tk.Entry(app1,width=20)
txt.place(x=30,y=80)
lbl1=tk.Label(app1,text='Herr')
lbl1.place(x=180,y=80)
lbl2=tk.Label(app1,text='Produktname')
lbl2.place(x=30,y=120)
lbl5=tk.Label(app1,text=str(a))
lbl5.place(x=30,y=180)
lbl8=tk.Label(app1,text=str(b))
lbl8.place(x=30,y=210)
lbl3=tk.Label(app1,text='Listenpreis')
lbl3.place(x=250,y=120)
lbl6=tk.Label(app1,text=str(a1))
lbl6.place(x=250,y=180)
lbl9=tk.Label(app1,text=str(b1))
lbl9.place(x=250,y=210)
lbl4=tk.Label(app1,text='Partition')
lbl4.place(x=400,y=120)
lbl7=tk.Label(app1,text=str(int(a1)*0.8))
lbl7.place(x=400,y=180)
lbl10=tk.Label(app1,text=str(int(b1)*0.8))
lbl10.place(x=400,y=210)
lbl11=tk.Label(app1,text='gesamt')
lbl11.place(x=200,y=240)
lbl12=tk.Label(app1,text=str(int(a1)+int(b1)))
lbl12.place(x=250,y=240)
lbl13=tk.Label(app1,text=str(int(a1)*0.8+int(b1)*0.8))
lbl13.place(x=400,y=240)
back_button = tk.Button(app1, text="PDF")
back_button.pack()
app.mainloop()
Recommended Posts