Skip to main content

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, or PyQt)

Usage

Quick start

import argparse
import argparseqt.gui

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 = argparseqt.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


Download files

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

Files for argparseqt, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size argparseqt-0.3.2-py3-none-any.whl (8.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size argparseqt-0.3.2.tar.gz (7.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page