Skip to content

Instantly share code, notes, and snippets.

@blndev
Created January 8, 2019 17:15
Show Gist options
  • Save blndev/3ee4d0b534b91f9fed6dcb837d51bec6 to your computer and use it in GitHub Desktop.
Save blndev/3ee4d0b534b91f9fed6dcb837d51bec6 to your computer and use it in GitHub Desktop.
Simple "Hello World" Dialog for Python
import tkinter #in python 3.x: tkinter wird kleingeschrieben
window = tkinter.Tk()
window.title("TK Sample")
window.geometry("400x100")
frame = tkinter.Frame(window, relief="ridge", borderwidth=2)
frame.pack(fill="both",expand=1)
label = tkinter.Label(frame, text="Hello World!")
label.pack(expand=1)
button = tkinter.Button(frame,text="OK",command=window.destroy)
button.pack(side="bottom")
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment