An easy way to make Qt GUIs using the argparse standard module
Project description
argparseqt
An easy way to make Qt GUIs using the argparse standard module
Installation
Via pip:
pip install argparseqt
From source:
git clone https://github.com/domstoppable/argparseqt.git
cd argparseqt.git
python setup.py install
Dependencies
Requires:
- qtpy
- Qt bindings for Python (either
PySide2
,PyQt5
,PySide
, orPyQt
)
Usage
Quick start
parser = argparse.ArgumentParser(description='Main settings')
parser.add_argument('--storeConst', action='store_const', const=999)
textSettings = parser.add_argument_group('Strings', description='Text input')
textSettings.add_argument('--freetext', type=str, default='Enter freetext here', help='Type anything you want here')
textSettings.add_argument('--pickText', default='I choo-choo-choose you', choices=['Bee mine', 'I choo-choo-choose you'], help='Choose one of these')
app = QtWidgets.QApplication()
dialog = argparsegui.gui.ArgDialog(parser)
dialog.exec_()
if dialog.result() == QtWidgets.QDialog.Accepted:
values = dialog.getValues()
print('Values:', values)
else:
print('User cancelled')
See example.py for more.
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
argparseqt-0.2.3.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for argparseqt-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eac4cb3a6bd2c424d86b454ed2306baf29a035f4016cd7e7f349b1de1169a4c |
|
MD5 | db84468059d7c6c9833675cb5db09a66 |
|
BLAKE2b-256 | 2ad36c1a54a15e60674926c63c08206f65a1f42f19b997aa0133b5023e95ab30 |