Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Uhr ohne OOP, Py3
- # D. Hirschi 2019
- from tkinter import *
- from time import *
- from threading import *
- def ende():
- top.destroy()
- def update_zeit():
- while(1==1):
- zeit = asctime()
- print(zeit)
- Label1.config(text = zeit)
- sleep(1)
- # Definition des GUI
- top=Tk()
- top.geometry("300x150")
- top.title("Uhr ohne OOP")
- Label1 = Label(top)
- Label1.config(font=("Courier", 24))
- Label1.pack()
- Ende=Button(top,text="Ende", command=ende)
- Ende.pack(side="right")
- threads = []
- t1 = Thread(target=update_zeit)
- threads.append(t1)
- t1.start()
- # Endlosschleife, die das Programm ausführt
- top.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement