1. Pyroom
  2. Tutorials
  3. Python Tkinter
  4. Make a Tkinter window with a button

Make a Tkinter window with a button

Tkinter builds real windows with buttons and text. In Pyroom the window appears in the preview panel.

Beginner Video coming soon. The steps below show everything the video will cover.

Steps

  1. Import tkinter, create a window and a button. command says which function runs on click.
  2. Run it. The window opens in the preview panel.
  3. Click the button. The function runs and prints to the console.
Read the transcript

Import tkinter, create a window and a button. command says which function runs on click.

Run it. The window opens in the preview panel.

Click the button. The function runs and prints to the console.

Try it in the Playground

Nothing to install and no account needed.

Open Playground →