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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b4aa850bea637ed944e4a51986400feb2ab1fd3e32d33fa9a2b7340ce85c5ef |
|
MD5 | c7f6626e2d13d805def0a7163ce0a894 |
|
BLAKE2b-256 | d4829fb9546f5c6b633ee3bc926ea56d9e8925a63d438b6876521d7f2315e556 |
Hashes for PySimpleGUIDesigner-0.1.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f6cdf35e59c142c310ece94d868c7f2e96e27af896d037441eb04a56f3a61f2 |
|
MD5 | 28f6e1b90cc3042de0c0b1d20233c54f |
|
BLAKE2b-256 | 7754e53d2178ba5e6e5ada7b581f5b2febc3a8f604b333114240b496354285ef |