Tutorial by Examples

Tkinter comes pre-installed with the Python installer binaries for Mac OS X and the Windows platform. So if you install Python from the official binaries for Mac OS X or Windows platform, you are good to go with Tkinter. For Debian versions of Linux you have to install it manually by using the foll...
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 (see remarks section about "Differences between Python 2 and 3") In Python 3 the module tkinter has a lowercase t: import t...
import tkinter as tk class HelloWorld(tk.Frame): def __init__(self, parent): super(HelloWorld, self).__init__(parent) self.label = tk.Label(self, text="Hello, World!") self.label.pack(padx=20, pady=20) if __name__ == "__main__": ...

Page 1 of 1