Skip to main content

PySimpleGUI designer, that uses transpiler to produce PySimpleGUI code from Qt Designer xml file.

Project description

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?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySimpleGUIDesigner-0.1.4.7.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file PySimpleGUIDesigner-0.1.4.7.tar.gz.

File metadata

  • Download URL: PySimpleGUIDesigner-0.1.4.7.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for PySimpleGUIDesigner-0.1.4.7.tar.gz
Algorithm Hash digest
SHA256 7f74097ef68c76e0e59f2c7ca7ee9fbd612160528352a27ac4325e8521c5483e
MD5 c46d199300cd13f8b06bd9c066c13b07
BLAKE2b-256 1c235fe5e39510beff64090371a7552ff4b5e139beb9d9d61b2d64b995791a49

See more details on using hashes here.

File details

Details for the file PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl.

File metadata

  • Download URL: PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for PySimpleGUIDesigner-0.1.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 789554202978fed7f5b02303425b8245f7b999fb291feea6c3f22f6e57761a40
MD5 f9f27af562c0a23ece76758e3df35936
BLAKE2b-256 1ebd85cbde9056876f0d74889236fe2f3a2083d40bf807f10dadab774b989e0a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page