A simple GUI designer for the python tkinter module

Overview

Build Status

Leer en Español

Welcome to Pygubu!

Pygubu is a RAD tool to enable quick and easy development of user interfaces for the Python's tkinter module.

The user interfaces designed are saved as XML files, and, by using the pygubu builder, these can be loaded by applications dynamically as needed.

Pygubu is inspired by Glade.

Installation

Pygubu works with Python 2.7 or Python 3

pip install pygubu

Usage

Since version 0.10 the project was splitted in two main modules:

  • The pygubu core (this project), that load and build user interfaces defined in xml.
  • The interface editor pygubu-designer, that helps you create the xml definition graphically

Start creating your tkinter application xml UI definition using the pygubu-designer editor.

The following is a UI definition example called helloworld.ui:

<?xml version='1.0' encoding='utf-8'?>
<interface>
  <object class="tk.Toplevel" id="mainwindow">
    <property name="height">200</property>
    <property name="resizable">both</property>
    <property name="title" translatable="yes">Hello World App</property>
    <property name="width">200</property>
    <child>
      <object class="ttk.Frame" id="mainframe">
        <property name="height">200</property>
        <property name="padding">20</property>
        <property name="width">200</property>
        <layout>
          <property name="column">0</property>
          <property name="propagate">True</property>
          <property name="row">0</property>
          <property name="sticky">nsew</property>
          <rows>
            <row id="0">
              <property name="weight">1</property>
            </row>
          </rows>
          <columns>
            <column id="0">
              <property name="weight">1</property>
            </column>
          </columns>
        </layout>
        <child>
          <object class="ttk.Label" id="label1">
            <property name="anchor">center</property>
            <property name="font">Helvetica 26</property>
            <property name="foreground">#0000b8</property>
            <property name="text" translatable="yes">Hello World !</property>
            <layout>
              <property name="column">0</property>
              <property name="propagate">True</property>
              <property name="row">0</property>
            </layout>
          </object>
        </child>
      </object>
    </child>
  </object>
</interface>

Then, you should create your application script as shown below (helloworld.py):

# helloworld.py
import tkinter as tk
import pygubu


class HelloWorldApp:
    
    def __init__(self):

        #1: Create a builder
        self.builder = builder = pygubu.Builder()

        #2: Load an ui file
        builder.add_from_file('helloworld.ui')

        #3: Create the mainwindow
        self.mainwindow = builder.get_object('mainwindow')
        
    def run(self):
        self.mainwindow.mainloop()


if __name__ == '__main__':
    app = HelloWorldApp()
    app.run()

Note that instead of helloworld.ui, you should insert the filename (or full path) of your UI definition:

builder.add_from_file('your_ui_definition.ui')

Note also that instead of 'mainwindow', you should have the name of your main_widget (the parent of all widgets) in the following line:

self.mainwindow = builder.get_object('_your_main_widget_')

Documentation

Visit the pygubu wiki for more documentation.

The following are some good tkinter (and tk) references:

You can also see the examples directory or watch this introductory video tutorial.

History

See the list of changes here.

Owner
Alejandro Autalán
Alejandro Autalán
HDLG is a modern cross-platform GUI for hdl-dump with Batch installation capabilities.

HDLG is a modern cross-platform GUI for hdl-dump with Batch installation capabilities. Looking for Artwork This project is looking for an Icon an

8 Dec 03, 2022
Advanced GUI Calculator with Beautiful UI and Clear Code.

Advanced GUI Calculator with Beautiful UI and Clear Code.

Mohammad Dori 3 Jul 15, 2022
Key Cast - Cast your key presses and mouse clicks on the screen, while casting your favorite application on the screen. Better than the rest.

Key Cast Screen cast your keyboard and mouse clicks in style Project Homepage » View Demo · Report Bug · Request Feature Table of Contents Introductio

Mehul Singh Teya 13 Dec 23, 2022
Edifice: a declarative GUI library for Python

Edifice is a Python library for building reactive UI, inspired by modern Javascript libraries such as React.

David Ding 193 Dec 11, 2022
PyEditor - A Simple Text Editor for python

PyEditor work in progress Text Editor for python Installation git clone https://github.com/ArmenG888/PyEditor Install the libraries Linux or mac pip

ArmenG 3 Mar 15, 2022
Primeira interface (simples) desenvolvida em Python utilizando o PySimpleGUI

Interface-Python Sobre o projeto Primeira interface gráfica (simples) desenvolvida em Python utilizando o PySimpleGUI Interface Gráfica Tecnologias ut

Matheus Maia Alvarez 5 Apr 09, 2022
A very simple calculator with a modern UI made in Python thanks for the stunning Sun-Valley-ttk-theme and Segoe UI Variable font.

Fluent-Python-Calculator A simple Python calculator with Sun-Valley-ttk-theme About Fluent-Python-Calculator: A very simple calculator with a modern U

59 Dec 06, 2022
LittlePythonGUIGuide - This is a short GUI Guide with python

This is a short GUI Guide with python, learning how to use the simple and easy moduel built into python, named tkinter.

1cy50ng3b0b 1 Nov 21, 2021
Bill Cipher is a Python3 Tkinter Application that creates Python remote backdoors, while giving you the option to convert it to an exe.

Bill Cipher is a Python3 Tkinter Application that creates Python remote backdoors, while giving you the option to convert it to an exe. The program also configures a .py server file that works with t

Damian Mostert 2 Apr 12, 2022
GUI based app made in python using tkinter

Virtual Keyboard A GUI application made in python using tkinter This is my first ever proper GUI based application project after learning tkinter rece

AbhineetK 10 Dec 10, 2022
`rosbag filter` with Gooey-based GUI

rosbag_filter_gui rosbag filter with Gooey-based GUI Test-passed Ubuntu 20.04 ROS Noetic Python 3.8 Installation

Yujie He 2 Dec 07, 2021
A graphical user interface calendar with python

GUI-Calendar A graphical user interface calendar with python In this project I used tkinter module If you dont have tkinter module you can install it

Arone Sadegh 1 Dec 18, 2021
A really minimalistic operating system made using python's GUI module Tkinter.

BoxOS V1.0.0 About A really minimalistic operating system made using python's GUI module Tkinter. What seperates it from the other operating systems m

Fahim 2 Dec 08, 2022
Introduce QML-like declarative structure to Python world. Developer writes only pure Python code for QML.

Introduce QML-like declarative structure to Python world. Developer writes only pure Python code for QML.

likianta 4 Mar 27, 2022
Create highly interactive web pages purely in Python

A package for building highly interactive user interfaces in pure Python inspired by ReactJS.

701 Jan 03, 2023
Software com funçoes de A a Z feito no Python

Introdução Iniciante em programação Python, decidi criar um programa com diversas ferramentas de A a Z. Funções Ferramenta de Gerenciamento e Manutenç

João Pedro 1 Jan 26, 2022
A Python native, OS native GUI toolkit.

Toga A Python native, OS native GUI toolkit. Prerequisites Minimum requirements Toga requires Python 3. Python 2 is not supported. If you're on macOS,

BeeWare 3.3k Jan 02, 2023
yfinance is a library where you can see stocks, crypto and tickers information

yfinance is a library where you can see stocks, crypto and tickers information.

Joaquin 3 Nov 19, 2022
TextTUI is a set of extensions to the Textual and Textual-Inputs libraries

TextTUI is a set of extensions to the Textual and Textual-Inputs libraries. Currently a Work in Progress that is based on the 0.1.14 branch of

3 Feb 10, 2022
NiceGUI is an easy to use, Python-based UI framework, which renderes to the web browser.

NiceGUI NiceGUI is an easy to use, Python-based UI framework, which renderes to the web browser. You can create buttons, dialogs, markdown, 3D scences

Zauberzeug GmbH 419 Jan 09, 2023