ich bin dabei mein erstes Programm in Pyton zu basteln.
Vorher habe ich nur in PHP und Gambas rumgemacht
In Zeile 6 bekomme ich einen Syntax Error
hier das ganze Programm
Code: Alles auswählen
from Tkinter import *
def rechne():
anzStabe = eingabe_g.get() / (eingabe_max.get() + eingabe_s.get() )
dickegesamt = eingabe_g.get() - (anzStabe * eingabe_s.get() )
abstand = dickegesamt / (anzStabe + 1)
abstand = Round(abstand, -1)
lab_a2=Label(root,text=abstand)
root = Tk()
root.title('Digi´s Abstandsrechner')
c = Canvas(root, width="376",height="160")
c.pack()
bild = PhotoImage(file="/home/dirk/Projekte/Gambas/stabkalk/bild1.gif")
c.create_image(0, 0, anchor=NW, image=bild)
lab_s=Label(root,text="Sabstaerke S")
lab_s.place(x=3,y=170)
eingabe_s=Entry(root,width=5)
eingabe_s.place(x=91,y=170)
lab_s2=Label(root,text="mm")
lab_s2.place(x=136,y=170)
lab_g=Label(root,text="Innenmaß Rahmen G")
lab_g.place(x=166,y=170)
eingabe_g=Entry(root,width=6)
eingabe_g.place(x=297,y=170)
lab_s3=Label(root,text="mm")
lab_s3.place(x=350,y=170)
lab_max=Label(root,text="Abstand A darf maximal")
lab_max.place(x=10,y=210)
eingabe_max=Entry(root,width=5)
eingabe_max.place(x=160,y=210)
lab_max2=Label(root,text="mm betragen")
lab_max2.place(x=204,y=210)
lab_a=Label(root,text="Abstand A betraegt")
lab_a.place(x=100,y=250)
lab_a2=Label(root,text="")
lab_a2.place(x=220,y=250)
but=Button(root,text="Stababstaende ausrechnen",command=rechne)
but.place(x=100,y=270)
root.mainloop()