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.7.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

pygenerategui-0.0.7-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygenerategui-0.0.7.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for pygenerategui-0.0.7.tar.gz
Algorithm Hash digest
SHA256 4ac9145c472a1948650520e5e2aff80b61b9a77d0391806559a6cf39bd0dbb84
MD5 bcbf9a775684dafd0f5205e38229879a
BLAKE2b-256 19f6867afb24b8cf232829f0c69021d734461d1cb7ba70e250bba1d2b3b8c2ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygenerategui-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for pygenerategui-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5020ed138e755828e5dc2a501612b1d71f0b5709e4eb9f839021b6b30afdba87
MD5 60959fd00311fade03747b5ac42a7809
BLAKE2b-256 2a7841497d95f3f6e5136ef11e4f6b6f0dfb0525f30c7c40f7f27f6f41c5a6b3

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