Skip to main content

PySimpleGUI Designer

designer

How do I use PySimpleGUIDesigner WITH Qt Designer? Watch this video (by me): https://www.youtube.com/watch?v=dN7gXwnNoBA

Install:

            THIS PACKAGE         Requirements 
pip install PySimpleGUIDesigner  PySide2 click

Usage

Use GUI(by default):

PySimpleGUIDesigner

Use CLI:

PySimpleGUIDesigner -xml "~/folder1/test.ui" -ob "somegroupBox"

Want to know parameters? Get help by:

PySimpleGUIDesigner --help
# 
# Output:
# 
Usage: main.py [OPTIONS]

Options:
  -v, --verbose                   Verbose mode
  -xml, --xmlfile PATH            absolute or relative path to ui_file
  -ob, --objname TEXT             Object name of target container
  -nobadwidgets                   Forget about not-implemented(bad) widgets.
                                  Default - True

  -ic, --indent_char TEXT         Indent character. Default is " "
  -ia, --indent_char_amount INTEGER
                                  Indent amount
  -o, --outputfile PATH           Output file for PySimpleGUI code
  -pp_mouse                       Option - generate buttons events
  -pp_keys                        Option - generate all events
  --help                          Show this message and exit.

I want to use source code directly (from this repo code)

Ok(I don't know you need this), but here are the steps.

Let's imagine you say "I don't want pip install, I want to donwload this repo and run code. How can I do this?"

Solution 1:

# removing (if installed) PySimpleGUIDesigner:
pip uninstall -y PySimpleGUIDesigner

mkdir psgdesigner
cd psgdesigner
git clone https://github.com/nngogol/PySimpleGUIDesigner
python3 -m PySimpleGUIDesigner
# NOTE for Windows users: replace "python3"   with   "python" OR "py"

# ALSO, output "help" by:
# $ python3 -m PySimpleGUIDesigner --help

Solution 2:

mkdir psgdesigner
cd psgdesigner
git clone https://github.com/nngogol/PySimpleGUIDesigner
cd PySimpleGUIDesigner
python3 -m main_for_devel.py
# for Windows users: replace "python3"   with   "python" OR "py"

Examples (fun part)

Using as normal (easy):
python3 main.py --xmlfile="~/folder1/test.ui" --objname="somegroupBox"
# a bit shorter command:
python3 main.py -xml "~/folder1/test.ui" -ob "somegroupBox"

hot-reloader trick For Unix-like OS

I like to use watch command. This command will compile every 3 second and output to the screen:

watch -n 3 PySimpleGUIDesigner -xml "~/folder1/test.ui" -ob somegroupBox

also, there is an entr command (install by apt install entr), which works even better. It makes you command, when file is changed:

This command will compile file ~/folder1/test.ui, when you change it(like you hit ctrl+s to save layout in .ui file):

echo "~/folder1/test.ui" | entr -p -s 'PySimpleGUIDesigner -xml "~/folder1/test.ui" -ob somegroupBox'

If you are on Windows OS without bash, then PySimpleGUIDesigner has build-it hot-reloader! So, use it, if you need.

Redirect output

Use bash redirect (or -o option):

PySimpleGUIDesigner -xml untitled.ui -ob v1 > untitled.py
PySimpleGUIDesigner -xml untitled.ui -ob v1 -o untitled.py

More Examples:

#=================== Basics:
### using relative path:
python3 main.py -xmlfile "untitled.ui" -objname="text1"
python3 main.py -xmlfile "examples_of_ui/untitled.ui" -objname="vv1"

### using absolute path:
python3 main.py -xmlfile "/tmp/examples_of_ui/untitled.ui" -objname="text1"

#=================== Indent:
# ia = indent amount, ic = indent char
# indent 1:
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " "
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 1 # the same effect, as command above
# indent 2:
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 2

### add boilerplate to output file
python3 main.py -xmlfile "untitled.ui" -objname="text1" -pp_mouse -ic " " -ia 2
python3 main.py -xmlfile "untitled.ui" -objname="text1" -pp_keys
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 2 -pp_keys

Gogol, HELP me! I don't know what I'm doing!

Keep calm. I will try to help you.

Really do super easy thing - "Open Issue" in this repository: https://github.com/nngogol/PySimpleGUIDesigner/issues

Todo

  • [done] xml -> py
  • [interesting] psg code -> xml
  • add some picking templates for user
  • add some boilerplate's in output generated code
  • unit tests, pytest?

Release files for PySimpleGUIDesigner 0.1.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PySimpleGUIDesigner 0.1.4.7
File Size Uploaded
PySimpleGUIDesigner-0.1.4.7.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PySimpleGUIDesigner 0.1.4.7
File Interpreter ABI Platform
PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl Python 3 none any Details

Total release size: 43.6 kB

Release files / PySimpleGUIDesigner-0.1.4.7.tar.gz

Download URL PySimpleGUIDesigner-0.1.4.7.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7f74097ef68c76e0e59f2c7ca7ee9fbd612160528352a27ac4325e8521c5483e
BLAKE2b-256 checksum
How to use checksums
1c235fe5e39510beff64090371a7552ff4b5e139beb9d9d61b2d64b995791a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Release files / PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl

Download URL PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
789554202978fed7f5b02303425b8245f7b999fb291feea6c3f22f6e57761a40
BLAKE2b-256 checksum
How to use checksums
1ebd85cbde9056876f0d74889236fe2f3a2083d40bf807f10dadab774b989e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.1.4.7 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page