When to use it
Use Tkinter when students are ready to build interactive apps: a calculator, a quiz, a form that checks input, or a simple game on a Canvas.
Your first window
Import tkinter, create a window with Tk(), add widgets and start the main loop. The window appears in the preview panel next to the console.
import tkinter as tk
root = tk.Tk()
tk.Button(root, text="Click me", command=lambda: print("Hi!")).pack()
root.mainloop()
Widgets and events
- Label shows text; Entry reads what the user types; Button runs a function when clicked.
- Layout managers
pack() and grid() arrange widgets in rows and columns. - A Canvas draws shapes you can move, which is the base for simple games.
bind() connects keys and mouse clicks to your functions.
Learning path
The Beginner tutorial builds a window with a button. The Intermediate tutorial makes a small form with Entry and Label that responds to input. The Advanced tutorial moves a shape on a Canvas with the keyboard β a first mini-game.
Good to know
Pyroom's Tkinter follows standard Python behaviour, so the code also runs in desktop Python. Programs keep running until you stop them or close the window. For bigger Tkinter projects with many files, use Pro Mode or LaunchPad.
Feature overview β