About 4,260 results
Open links in new tab
  1. How to create a window with Python - Stack Overflow

    Jan 4, 2017 · The tkinter module is probably the most common Python GUI method. To make a button: from tkinter import * tk = Tk() btn = Button(tk, text="a clickable button", command()) btn.pack()

  2. Python Tkinter - GeeksforGeeks

    Dec 21, 2024 · To create a Tkinter Python app, follow these basic steps: Import the tkinter module: Import the tkinter module, which is necessary for creating the GUI components. Create the main window (container): Initialize the main application window using the Tk () class. Set Window Properties: We can set properties like the title and size of the window.

  3. Open a New Window with a Button in Python – Tkinter

    Apr 8, 2025 · In this guide, we will explore how to open a new window when a button is clicked using two approaches: Setting Up Tkinter. Tkinter comes pre-installed with Python. However, on some Linux distributions like Ubuntu, we may need to install it using: Creating a New Window Using a Function.

  4. Create Python GUI with Tkinter

    Jun 14, 2022 · These rectangular windows with buttons, icons and menus are an intuitive way to get things done. In this tutorial, we'll focus on building our own GUIs using Python and Tkinter. We'll begin by reviewing some of the basics, including creating a window and learning how to display images and text.

  5. An Essential Guide to Tkinter Window - Python Tutorial

    Summary: in this tutorial, you’ll learn how to manipulate various attributes of a Tkinter window. The following simple program shows the main window: Output: The main window has a title that defaults to tk. It also has three system buttons including Minimize, Maximize, and Close. Let’s learn how to change the attributes of the main window.

  6. python - How to code for a new window - Stack Overflow

    Apr 26, 2017 · Coding for the new window (or creating widgets in the new window) is similar to how you do it in the main window. Just pass the new window (toplevel) as the parent. Here is an example that creates a Label and an Entry widgets in the new window. toplevel = Toplevel() toplevel.title('result') toplevel.geometry('1500x1000')

  7. How to make a window with buttons in python - Stack Overflow

    How do I create a function that makes a window with two buttons, where each button has a specified string and, if clicked on, returns a specified variable?

  8. Python GUI Programming With Tkinter

    Dec 7, 2024 · First, create a window that contains a single widget. Start up a new Python shell session and follow along! Note: The code examples in this tutorial have all been tested on Windows, macOS, and Ubuntu Linux 20.04 with Python version 3.10.

  9. Tkinter Window Example - Python Examples

    In this Python Tkinter tutorial, we learned how to display a window using Tkinter, with examples. In this tutorial, you will learn how to create a basic Toplevel widget on screen using Tkinter, in other words a window, using tkinter.Tk class, with example.

  10. Tkinter Hello, World! - Python Tutorial

    Summary: in this tutorial, you’ll learn step-by-step how to develop the Tkinter “Hello, World!” program. The following program shows how to display a window on the screen: If you execute the program, you’ll see the following window: How it works. First, …

  11. Some results have been removed