Skip to main content

Python Auto GUI

Generate a Tkinter GUI from any Python program

  • Creates a Tkinter GUI to replace any command line interface
  • Interprets your existing code, removing the need for programming a GUI by hand.
  • Dynamically generates tidy applications, with quality of life features such as exporting data to CSV or PDF.
adventure quiz greetings
A choose-your-own adventure A simple maths quiz A hello world example

Quick-start

from autogui import print, input, run   # import overrides, and run function
run()   # start GUI

10 second example

from autogui import print, input, run   # import overrides, and run function
run()   # start GUI

myAnswer = input("What is your name?")    # renders a textbox and waits for user input

input("Click me to continue")   # renders a button and waits for user input

print("Hello, "+myAnswer)   # renders text
Function Feature
input() Creates a button and waits for the user to press it
var = input() Creates a text box and waits for the user to enter an input
print() Creates a label with the passed text
from autogui import input, run, footer   # import overrides, and run + footer functions
run()   # start GUI

myAnswer = input("What is your name?")    # renders a textbox and waits for user input

footer()   # renders a footer with export options
  • The footer function is an optional function that can be called at the end of your program to render a footer with export options.
  • These export options are:
Export Function
CSV Export Q/A's as a CSV file.
PDF Export as a PDF document (currently TODO).
JPG Export as a JPG image (currently TODO).
  • PDF and JPG export are not yet implemented, as usual methods of exporting the tkinter canvas using postscript don't support export of widgets.

Explaining the code

In order to work as a drop-in solution for existing code, we override existing functions in the Python language.

Print: The print function is overridden to create a label with the passed text.

Input: The input function analyzes the function call to determine if the user is requesting a text box or a button. If the function saves the returned value to a variable, it will create a text box. If the function output is not saved to a variable, it will create a button.

Thread communication: The Tkinter GUI runs in a seperate thread to the main application, in order to prevent UI blocking. Communication between the main application and the GUI is done using queues. Print and Input functions place messages in the queue, and the GUI reads them and renders the appropriate UI. The GUI can also place messages on a seperate queue, for instance to return user input from text boxes or buttons to the main application.

Themeing

Tkinter supports themes to improve the default look and feel of the GUI. rdbende/Azure-ttk-theme is the theme used in screenshots for this package (with "light" (default) and "dark" themes). If no theme folder is found in themes/azure.tcl relative to the main .py file, the default tkinter theme is used.

Setting a new theme

from autogui import print, input, run   # import overrides, and run function
run(theme_name="light", theme_source="folder/new_theme.tcl")   # start GUI

License

MIT

Metadata

Release files for pythonautogui 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonautogui 0.0.2
File Size Uploaded Provenance
pythonautogui-0.0.2.tar.gz 80.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pythonautogui 0.0.2
File Interpreter ABI Platform
pythonautogui-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 87.0 kB

Release files / pythonautogui-0.0.2.tar.gz

Download URL pythonautogui-0.0.2.tar.gz
Size 80.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3de0c538e4386f9edf39584da4dc144eb8ac6a00c3c0dceb079ec5ba5c0cf45f
BLAKE2b-256 checksum
How to use checksums
62430fda59da3795928a5c928d18e260b761890ef5e5f9ef0b7e93fd0a0a6c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / pythonautogui-0.0.2-py3-none-any.whl

Download URL pythonautogui-0.0.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e20f71d08270c5781893735b6742a803458da6ef6032d2de027bab217fadd05
BLAKE2b-256 checksum
How to use checksums
90327ad6e7b0e5e7941be06c05e06a605276c8f6db7f5cf90d2799e5776e3fd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for pythonautogui 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page