PySimpleGUI designer, that uses transpiler to produce code from Qt Designer xml file.
Project description
PySimpleGUI Designer
Install:
# Requirements: pyside2
# $ pip install PySide2
pip install PySimpleGUIDesigner
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.
Using source code (from this repo)
Let's imagine you say "I don't want pip install
, how to use this repo's source code?"
Download this repo, cd into it.
Run in the shell:
python3 main.py --help
# equivalent to:
# PySimpleGUIDesigner --help
If you see this error:
ModuleNotFoundError: No module named '__main__.transpiler2'; '__main__' is not a package
THEN just change in main.py
line from .transpiler2 import *
to from transpiler2 import *
Examples:
Using as normal (easy):
python3 main.py --xmlfile="~/folder1/test.ui" --objname="somegroupBox"
# OR
python3 main.py -xml "~/folder1/test.ui" -ob "somegroupBox"
I like to use watch
command. Next command will compile every 3 second and output to the screen:
watch -n 3 PySimpleGUIDesigner -xml "~/folder1/test.ui" -ob somegroupBox
Redirect
Use (bash) redirect (OR -o
option):
PySimpleGUIDesigner -xml untitled.ui -ob v1 > untitled.py
PySimpleGUIDesigner -xml untitled.ui -ob v1 -o untitled.py
(You can use auto-update in GUI)
More Examples:
#=================== Basics:
### relative path
python3 main.py -xmlfile "untitled.ui" -objname="text1"
python3 main.py -xmlfile "examples_of_ui/untitled.ui" -objname="vv1"
### absolute path
python3 main.py -xmlfile "/tmp/examples_of_ui/untitled.ui" -objname="text1"
#=================== Indent:
# ia = indent amount, ic = indent char
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
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
Todo
Possible:
- improve
psg_ui_maker.py
- somewhere in__init__
method, maybe; - add some
picking templates
for user - add some
boilerplate
's in output generated code - maybe some unit tests, idk.
pytest
?
FAQ
How do I use PySimpleGUIDesigner WITH Qt Designer? Watch this video (by me):
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PySimpleGUIDesigner-0.1.4.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cdb8d11f7fa6bd94767243da2ab591245a7fbadaf06a746d5224ffdab7109f5 |
|
MD5 | c21277b76ed2efa00d67a00f53241c79 |
|
BLAKE2b-256 | 88963a79c799c8bc5da9d6057dc1d1ae9f65fcd66c51c30e286edcc971226875 |
Hashes for PySimpleGUIDesigner-0.1.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8763ecc476a86f932f28c2fecc3376505f9050b4bbcd6a34fc953689eb8dc55f |
|
MD5 | 01a61df3f3bafe1b8fa1b90a9cb9dcaa |
|
BLAKE2b-256 | c7fe66b776a780a19176a01454b8709b81365c2f1e1e1cd2f1a2d65a841e639b |