Skip to main content

Utility for generating simple GUI to execute Python code

Project description

pygenerategui

Utility for generating simple GUI to execute Python code

This was originally a hobby project, but I realized it could be useful at work. I'm an SDET, and I think this could be a handy way to e.g. expose an existing automation library's functionality to people uncomfortable with scripting. I'm sure it could be valuable in any number of other cases.

I've chosen the painful option of tkinter for the sake of maximum portability. You shouldn't need any modules that don't come in a typical python install.

Run python example_app_base.py for examples

Most functionality is demonstrated in example_module.py

Basic Usage

  • Decorate functions with @pggui. Make an app launcher file modeled after example_app_base.py, then run it with python (or maybe make a shell script to do so, so that your target users just have to double-click a file. :)
    • Function args should have type hinting or be overridden (see advanced section)
    • Param / return info from docstring is shown in UI
    • Default values are set
    • Return or error are displayed

Advanced Usage

  • Function name can be replaced in ui by specifing name argument of decorator
  • Arguments can be limited to a predefined set using dict, enum, or list by overriding the arg in decorator args
    • This is also useful if the argument is not a basic type (bool, string, number)
  • Example: @pggui(name='MyFunc', arg2=some_dict)
  • Arguments can also be overridden with another function, which will then be nested in the gui

TODO

  • Add ability for returned values to be stored and passed in to some other function
    • Mitigated with results in selectable text, for now
  • Better error messaging

Send me a note if you're using this, I'm curious!

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

pygenerategui-0.0.8.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

pygenerategui-0.0.8-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file pygenerategui-0.0.8.tar.gz.

File metadata

  • Download URL: pygenerategui-0.0.8.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.4

File hashes

Hashes for pygenerategui-0.0.8.tar.gz
Algorithm Hash digest
SHA256 68c21fe07d4b7bb1258c8a07729540c5def3d3685e54132c9f8c0dc37e0e7cac
MD5 c62605e657102ba446b0117cbc018afb
BLAKE2b-256 f0287893e9921b05d131fa6ed2234b84945f5ba3636a455ccdf582ec3326b039

See more details on using hashes here.

File details

Details for the file pygenerategui-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: pygenerategui-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.4

File hashes

Hashes for pygenerategui-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7e513b23f3e25fb1385f1e8896c7f9f99996fb78b5fba5064829c3d37defd8
MD5 e5dafd2afe7ba218adb2e298e9989186
BLAKE2b-256 4395ca894f81c2450a507cd418a975c09a44f7b4a0148b84ad665094a0687716

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