Hello Wold in Python Tkinter
Hello Wold in Python Tkinter
Let's test our basic knowledge of tkinter by creating the classic "Hello, World!" program.
First, we must import tkinter, this will vary based on version.
import tkinter as tk # Python 3.x Version #import Tkinter as tk # Python 2.x Version root = tk.Tk() label = tk.Label(root, text="Hello World!") # Create a text label label.pack(padx=20, pady=20) # Pack it into the window root.mainloop()
Comments
Post a Comment