Mit Drucken wird nur auf das Terminal oder ein fp gedruckt. Sie können ein neues Label erstellen, um es auf der GUI auszudrucken.
from Tkinter import *
def printSomething():
# if you want the button to disappear:
# button.destroy() or button.pack_forget()
label = Label(root, text= "Hey whatsup bro, i am doing something very interresting.")
#this creates a new label to the GUI
label.pack()
root = Tk()
button = Button(root, text="Print Me", command=printSomething)
button.pack()
root.mainloop()
EIN BEISPIEL FÜR IHREN KOMMENTAR
from Tkinter import *
def printSomething():
# if you want the button to disappear:
# button.destroy() or button.pack_forget()
for x in range(9): # 0 is unnecessary
label = Label(root, text= str(x))
# this creates x as a new label to the GUI
label.pack()
root = Tk()
button = Button(root, text="Print Me", command=printSomething)
button.pack()
root.mainloop()
Ich bin neu in GUI Dinge, wie kann ich es tun? Danke für die Anleitung. –