Probiere folgendes Beispiel in IDLE:
>>> from Tkinter import * >>> root=Tk() >>> lab=Label(root,text="Viel Spass mit dem Tkinter-Tutorial") >>> lab.pack()
Beschreibe jeweils die Veränderungen bei jedem Schritt!
Gib jetzt ein:
>>> lab=Label(root,text="Hallo G10b") >>> lab.pack()
Probiere auch:
>>> lab=Label(root,text="Hallo G10b",background="red") >>> lab.pack()
Zweites Beispiel:
>>> from Tkinter import * >>> root=Tk() >>> but=Button(root,text="Info") >>> but.pack()
Beschreibe jeweils die Veränderungen bei jedem Schritt!
Öffne den Editor und gib ein (abspeichern unter tkButton1.py):
from Tkinter import *
def nachricht():
lab=Label(root,text="Hallo G10b!")
lab.pack()
root=Tk()
but=Button(root,text="Info",command=nachricht)
but.pack()
Probiere auch (abspeichern unter tkButton2.py):
from Tkinter import *
def nachricht():
lab=Label(root,text="Viel Spass mit dem Tkinter-Tutorial")
lab.pack()
root=Tk()
but=Button(root,bitmap="questhead",command=nachricht)
but.pack()
Beschreibe die Veränderungen!
PS: IDLE mag keine Umlaute, finde heraus warum!