ich habe folgendes Problem...
Mein Programm läuft, aber die Ausgabe in der grafischen Benutzeroberfläche funktioniert nicht.
Es wird außerdem auch keine Fehlermeldung angezeigt, also ist das sehr verzwickt und ich weiß nicht weiter.
Gesucht und Ausgegeben werden sollen jeweils AV und BV(2 Auflagerkräfte, das Bild ist nicht im Internet importierbar. Ist nämlich eine eigene Skizze.
Freue mich, falls jemand das Problem kennt.
Code: Alles auswählen
from math import *
from tkinter import *
g = Tk()
g.title("Name, Matrikelnummer")
g = Canvas(highlightthickness = 0)
g.pack()
AV = ()
BV = ()
g.grid(column = 0, row = 0, columnspan = 3)
def Plot():
q = float(E_q.get())
LK1 = float(E_LK1.get())
L = float(E_L.get())
LK2 = float(E_LK2.get())
AV = float(((((L+0.5*LK1)*(LK1*q))+(L*0.5)*(L*q)-((LK2*0.5)*(q*LK2)))/(L)))
BV = float(((((-LK1*0.5)*(q*LK1))+((L*0.5)*(L*q))+((L+LK2*0.5)*(LK2*q)))/(L)))
bild = PhotoImage(file = "Layout2.gif")
Label(image = bild).grid(row = 0, column = 0, columnspan = 3)
Label(text = "q=").grid(row = 1, column = 0, sticky = "e")
E_q = Entry(width = 20)
E_q.grid(row = 1, column = 1, sticky = "w")
Label(text = "kn/m").grid(row = 1, column = 2, sticky = "w")
Label(text = "LK1=").grid(row = 2, column = 0, sticky = "e")
E_LK1 = Entry(width = 20)
E_LK1.grid(row = 2, column = 1, sticky = "w")
Label(text = "m").grid(row = 2, column = 2, sticky = "w")
Label(text = "L=").grid(row = 3, column = 0, sticky = "e")
E_L = Entry(width = 20)
E_L.grid(row = 3, column = 1, sticky = "w")
Label(text = "m").grid(row = 3, column = 2, sticky = "w")
Label(text = "LK2=").grid(row = 4, column = 0, sticky = "e")
E_LK2 = Entry(width = 20)
E_LK2.grid(row = 4, column = 1, sticky = "w")
Label(text = "m").grid(row= 4, column = 2, sticky = "w")
b1 = Button(text = "Berechnung", command = Plot)
b1.grid(row = 5, column = 1)
Label(text = "AV=").grid(row = 6, column = 0, sticky = "e")
AV=StringVar()
Label(textvariable = AV).grid(row = 6, column = 1, sticky = "w")
Label(text = "kN").grid(row = 6, column = 2, sticky = "w")
Label(text = "BV=").grid(row = 7, column = 0, sticky = "e")
BV=StringVar()
Label(textvariable = BV).grid(row = 7, column = 1, sticky = "w")
Label(text = "kN"). grid(row = 7, column = 2, sticky = "w")
g.update()
g.mainloop()