Simple minimal Tkinter program

This is a simple Tkinter program that run on Python 3. For previous version of Python, replace tkinter with Tkinter.

from tkinter import *

# Create a Tk root widget.
root = Tk()

# Create a Label widget as a child to the root window
simpleWin = Label(root, text="Hello from selinap.com!")

# Call the pack method to place the label on the window.
simpleWin.pack()

# The event loop.
root.mainloop()

Simple window using Tkinter

Related

This entry was posted in Python and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>