Name | pygubu JSON |
Version |
0.35
JSON |
| download |
home_page | None |
Summary | A simple GUI builder for the python tkinter module |
upload_time | 2024-04-17 00:46:31 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6 |
license | MIT |
keywords |
gui
tkinter
designer
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Build Status](https://travis-ci.org/alejandroautalan/pygubu.svg?branch=master)](https://travis-ci.org/alejandroautalan/pygubu)
[Leer en EspaƱol](LEEME.md)
Welcome to Pygubu!
==================
`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.
The user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.
Pygubu is inspired by [Glade](https://glade.gnome.org).
Installation
============
The latest version of pygubu requires Python >= 3.6
You can install pygubu using pip:
```
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](https://github.com/alejandroautalan/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](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.ui):
```xml
<?xml version='1.0' encoding='utf-8'?>
<interface version="1.2">
<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 manager="pack">
<property name="expand">true</property>
<property name="side">top</property>
</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 manager="pack">
<property name="side">top</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</interface>
```
Then, you should create your _application script_ as shown below ([helloworld.py](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.py)):
```python
# helloworld.py
import pathlib
import tkinter as tk
import tkinter.ttk as ttk
import pygubu
PROJECT_PATH = pathlib.Path(__file__).parent
PROJECT_UI = PROJECT_PATH / "helloworld.ui"
class HelloworldApp:
def __init__(self, master=None):
# 1: Create a builder and setup resources path (if you have images)
self.builder = builder = pygubu.Builder()
builder.add_resource_path(PROJECT_PATH)
# 2: Load a ui file
builder.add_from_file(PROJECT_UI)
# 3: Create the mainwindow
self.mainwindow = builder.get_object('mainwindow', master)
# 4: Connect callbacks
builder.connect_callbacks(self)
def run(self):
self.mainwindow.mainloop()
if __name__ == '__main__':
app = HelloworldApp()
app.run()
```
Note: instead of `helloworld.ui`, you should insert the _filename_ (or full path) of your UI definition:
```python
PROJECT_UI = PROJECT_PATH / "helloworld.ui"
```
Note: instead of 'mainwindow', you should have the name of your _main_widget_ (the parent of all widgets) in the following line:
```python
self.mainwindow = builder.get_object('_your_main_widget_')
```
Documentation
=============
Visit the [pygubu wiki](https://github.com/alejandroautalan/pygubu/wiki) for more documentation.
The following are some good tkinter (and tk) references:
- [TkDocs](http://www.tkdocs.com)
- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)
- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)
- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)
- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)
You can also see the [examples](https://github.com/alejandroautalan/pygubu-designer/tree/master/examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).
History
=======
See the list of changes [here](HISTORY.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "pygubu",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "gui, tkinter, designer",
"author": null,
"author_email": "Alejandro Autalan <alejandroautalan@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d7/ae/f976c986a73317407902038a90f6dfc1844c693a9d87a9f1ae1445bf0c7b/pygubu-0.35.tar.gz",
"platform": null,
"description": "[![Build Status](https://travis-ci.org/alejandroautalan/pygubu.svg?branch=master)](https://travis-ci.org/alejandroautalan/pygubu)\n\n[Leer en Espa\u00f1ol](LEEME.md)\n\nWelcome to Pygubu!\n==================\n\n`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.\n\nThe user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.\n\nPygubu is inspired by [Glade](https://glade.gnome.org).\n\nInstallation\n============\n\nThe latest version of pygubu requires Python >= 3.6\n\nYou can install pygubu using pip:\n\n```\npip install pygubu\n```\n\nUsage\n=====\n\nSince version 0.10 the project was splitted in two main modules:\n\n- The **pygubu core** (this project), that load and build user interfaces defined in xml.\n- The **interface editor** [pygubu-designer](https://github.com/alejandroautalan/pygubu-designer), that helps you create the xml definition graphically.\n\nStart creating your tkinter application xml UI definition using the pygubu-designer editor.\n\nThe following is a UI definition example called [helloworld.ui](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.ui):\n\n\n```xml\n<?xml version='1.0' encoding='utf-8'?>\n<interface version=\"1.2\">\n <object class=\"tk.Toplevel\" id=\"mainwindow\">\n <property name=\"height\">200</property>\n <property name=\"resizable\">both</property>\n <property name=\"title\" translatable=\"yes\">Hello World App</property>\n <property name=\"width\">200</property>\n <child>\n <object class=\"ttk.Frame\" id=\"mainframe\">\n <property name=\"height\">200</property>\n <property name=\"padding\">20</property>\n <property name=\"width\">200</property>\n <layout manager=\"pack\">\n <property name=\"expand\">true</property>\n <property name=\"side\">top</property>\n </layout>\n <child>\n <object class=\"ttk.Label\" id=\"label1\">\n <property name=\"anchor\">center</property>\n <property name=\"font\">Helvetica 26</property>\n <property name=\"foreground\">#0000b8</property>\n <property name=\"text\" translatable=\"yes\">Hello World !</property>\n <layout manager=\"pack\">\n <property name=\"side\">top</property>\n </layout>\n </object>\n </child>\n </object>\n </child>\n </object>\n</interface>\n```\n\nThen, you should create your _application script_ as shown below ([helloworld.py](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.py)):\n\n```python\n# helloworld.py\nimport pathlib\nimport tkinter as tk\nimport tkinter.ttk as ttk\nimport pygubu\n\nPROJECT_PATH = pathlib.Path(__file__).parent\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n\n\nclass HelloworldApp:\n def __init__(self, master=None):\n # 1: Create a builder and setup resources path (if you have images)\n self.builder = builder = pygubu.Builder()\n builder.add_resource_path(PROJECT_PATH)\n\n # 2: Load a ui file\n builder.add_from_file(PROJECT_UI)\n\n # 3: Create the mainwindow\n self.mainwindow = builder.get_object('mainwindow', master)\n\n # 4: Connect callbacks\n builder.connect_callbacks(self)\n\n def run(self):\n self.mainwindow.mainloop()\n\n\nif __name__ == '__main__':\n app = HelloworldApp()\n app.run()\n\n```\n\nNote: instead of `helloworld.ui`, you should insert the _filename_ (or full path) of your UI definition:\n\n```python\nPROJECT_UI = PROJECT_PATH / \"helloworld.ui\"\n```\n\nNote: instead of 'mainwindow', you should have the name of your _main_widget_ (the parent of all widgets) in the following line:\n\n```python\nself.mainwindow = builder.get_object('_your_main_widget_')\n```\n\nDocumentation\n=============\n\nVisit the [pygubu wiki](https://github.com/alejandroautalan/pygubu/wiki) for more documentation.\n\n\nThe following are some good tkinter (and tk) references:\n\n- [TkDocs](http://www.tkdocs.com)\n- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)\n- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)\n- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)\n- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)\n\n\nYou can also see the [examples](https://github.com/alejandroautalan/pygubu-designer/tree/master/examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).\n\n\nHistory\n=======\n\nSee the list of changes [here](HISTORY.md).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple GUI builder for the python tkinter module",
"version": "0.35",
"project_urls": {
"Documentation": "https://github.com/alejandroautalan/pygubu#readme",
"Issues": "https://github.com/alejandroautalan/pygubu/issues",
"Source": "https://github.com/alejandroautalan/pygubu"
},
"split_keywords": [
"gui",
" tkinter",
" designer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aee944b27d6d21b40ae71111807116a783cb636ffe4d7221607b2da1caffc743",
"md5": "164ac6f4230a0208ac160dd7ee274ca4",
"sha256": "5843c4382a049e7d066a77d3ce84d5b1e34f84b0aca2c7b94cfe1051e46490f4"
},
"downloads": -1,
"filename": "pygubu-0.35-py3-none-any.whl",
"has_sig": false,
"md5_digest": "164ac6f4230a0208ac160dd7ee274ca4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 175759,
"upload_time": "2024-04-17T00:46:27",
"upload_time_iso_8601": "2024-04-17T00:46:27.608400Z",
"url": "https://files.pythonhosted.org/packages/ae/e9/44b27d6d21b40ae71111807116a783cb636ffe4d7221607b2da1caffc743/pygubu-0.35-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d7aef976c986a73317407902038a90f6dfc1844c693a9d87a9f1ae1445bf0c7b",
"md5": "c872cb7702af6e2a681a7085d40aabd0",
"sha256": "1f893b2dd6cf9dc6ba202f0a66d8c536f24f75e858d0534fe42e8043d0b5445f"
},
"downloads": -1,
"filename": "pygubu-0.35.tar.gz",
"has_sig": false,
"md5_digest": "c872cb7702af6e2a681a7085d40aabd0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 140104,
"upload_time": "2024-04-17T00:46:31",
"upload_time_iso_8601": "2024-04-17T00:46:31.791299Z",
"url": "https://files.pythonhosted.org/packages/d7/ae/f976c986a73317407902038a90f6dfc1844c693a9d87a9f1ae1445bf0c7b/pygubu-0.35.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-17 00:46:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alejandroautalan",
"github_project": "pygubu#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pygubu"
}