Button guide
Add a GUI to a Python script 5 ways from Tkinter and Gooey to a browser form colleagues use without installing Python
If the GUI is just for you, wrap your argparse script with @Gooey or build a small window in Tkinter or FreeSimpleGUI. If you're building it so colleagues can run the script, a desktop GUI still means getting Python (or a packaged .exe) onto every person's computer. Button (https://button.bitgate.dev) turns the script on your own computer into a browser form your colleagues can run without installing anything, with a Free plan ($0 for 1 tool, 3 people and 100 runs/month) and a Pro plan ($15/month for 50 tools, 250 people and 5,000 runs/month).
Desktop GUI vs. browser form
Before writing GUI code, decide where the script is actually going to run.
| Approach | What you change in your script | What colleagues need on their computer | Where the Python script runs |
|---|---|---|---|
| Tkinter | Add widget and layout code | Python (plus python3-tk on Debian/Ubuntu) or a packaged .exe |
Their computer |
| Gooey | Add @Gooey above main() |
Python + Gooey (wxPython) or a packaged .exe |
Their computer |
| FreeSimpleGUI | Add a layout list and event loop | Python + FreeSimpleGUI or a packaged .exe |
Their computer |
| NiceGUI / Streamlit | Rewrite inputs and outputs with library calls | A browser (on your LAN, or a hosted app) | Your computer or a server |
| Button | Take arguments via argparse |
A browser and an invite email (files up to 25 MB each, 30 minutes per run) | Your computer |
When you are the only user, or when colleagues already have a working Python environment on their machines, a desktop library is usually the better choice. You get a native window and you don't depend on a network connection.
1. Tkinter (standard library)
Tkinter is the standard library option. It ships with the python.org installers for Windows and macOS, so there is nothing to pip install there, though on Debian and Ubuntu you have to install the python3-tk package first.
Pick Tkinter when you want a desktop window with zero third-party dependencies and you're willing to write the widget callbacks yourself. You'll import tkinter (and tkinter.filedialog if the script takes files), lay out labels, entries and a Run button, and call your existing function from the button handler.
2. Gooey (argparse to GUI with one decorator)
If your script already uses argparse, Gooey is the fastest way to get a real desktop window. It reads your ArgumentParser definitions and builds a wxPython GUI from them. Its October 2026 release was the first since 2021, so check that it installs cleanly on your Python version.
- Install Gooey:
pip install Gooey
- Add the
@Gooeydecorator to the function that sets upargparse:
from argparse import ArgumentParser
from gooey import Gooey
@Gooey
def main():
parser = ArgumentParser()
parser.add_argument("--input", required=True, help="Input file path")
parser.add_argument("--limit", type=int, default=100, help="Row limit")
args = parser.parse_args()
print(f"Processing {args.input} with limit {args.limit}")
if __name__ == "__main__":
main()
- Run the script normally with
python my_script.py. A window opens with fields for--inputand--limit.
The catch is distribution. Colleagues still need Python and wxPython installed, or you have to bundle the whole thing into an executable for their operating system.
3. FreeSimpleGUI
If you don't use argparse, or you want more control over the layout than Gooey gives you without full Tkinter boilerplate, look at FreeSimpleGUI, the community fork of PySimpleGUI's open-source version. (PySimpleGUI itself went commercial in 2024 and returned to an open-source license in 2026.)
You define a window layout as a nested Python list of elements (text boxes, file browse buttons, a submit button), read the values back in a short loop, and pass them to your script's main function. Flet is another option if you want multi-platform apps in Python built on Flutter.
4. A local web UI: NiceGUI or Streamlit
Instead of a desktop window, you can put a browser UI on top of your script. NiceGUI and Streamlit both let you build web UIs in Python without writing HTML or JavaScript.
With Streamlit, you replace your argparse setup with widgets like st.file_uploader and st.download_button. streamlit run app.py serves the app at http://localhost:8501 and on a Network URL for your LAN.
If colleagues should use that app, know how access works: anyone on your network can open the Network URL with no login by default; st.login() adds sign-in through an OpenID Connect provider, but you write the email allowlist check yourself; and Streamlit Community Cloud hosts one private app for free, which sleeps after 12 hours without traffic.
Pick Streamlit or NiceGUI when you want an interactive web app with charts or live tables on screen, and you're comfortable running a web process or deploying from GitHub.
5. A browser form on your own script with Button
If the real goal is "let two or three people in another department run my script with their own CSVs", you don't actually need to write GUI code in Python at all. Button (https://button.bitgate.dev) turns a command-line script on your computer into a web form. Any program works - Python, Node, R, PowerShell, shell scripts, compiled binaries.
Jobs run on your computer, never in Button's cloud, while Button's servers relay the form values and files between the browser and your machine. Because it runs on your computer, your existing Python version, virtual environment and local files are already there.
Prepare your script
- Make the script take its inputs as command-line arguments with
argparseinstead of hard-coded paths orinput()prompts. - Take each input file path as an argument, and write the results as files into an output folder that is also passed as an argument.
Fixed flags such as --limit are part of the command you approve; colleagues only supply the values for the form fields.
Publish the form in Button
- Sign in at button.bitgate.dev.
- Install the Button runner on your computer (macOS, Linux or Windows) with the one-line command the site shows you (
curlon macOS and Linux, PowerShell on Windows). - Open the local setup page, pick your Python script, and describe its inputs (text, number, yes/no, choice, files).
- Publish the tool and invite your colleagues by email. Button gives the tool its own page.
Colleagues open the link from their invite email, sign in with Google or a one-time email code, fill in the form, press Run and download the results. They install nothing and never pay.
How execution, security and limits work
The runner only executes the exact command you approved on that computer, pinned by hash. Every form value is passed to your program as its own argument, with no shell, and a value can't start with -. If you change a tool, people have to confirm the new version before running it. Every run is logged with who ran it and when, and you can revoke access or set it to expire at any time.
Keep the limits in mind before picking Button:
- Your computer has to be on and online when someone runs the tool (tool pages show Ready, Busy or Offline), and it runs one job at a time per computer. Each workspace connects to one computer on every plan, and pairing a new computer replaces the previous one.
- Runs can take up to 30 minutes, with logs up to 1 MB per run.
- Files can be up to 25 MB each, up to 8 files and 100 MB per run. Inputs are deleted 24 hours after a run ends, and outputs after 7 days.
- Free is $0 for 1 published tool, 3 people, 100 runs and 1 GB of transfer per month. Pro is $15/month ($144/year) for 50 tools, 250 people, 5,000 runs and 50 GB per month.
FAQ
Do I need to change my Python code to use Button?
No GUI library imports are needed. As long as your script accepts its inputs and an output folder as command-line arguments (for example with argparse), Button passes the form values straight to your command.
What happens if my computer is asleep when a colleague opens the Button page?
Your computer has to be on and online for a job to run. The tool page shows Ready, Busy or Offline so colleagues can see right away if your machine isn't available.
Does my data stay on my computer with Button?
The script itself executes on your computer, not in Button's cloud, so your code and local environment stay on your machine. However, the form values, uploaded input files and output files pass through Button's servers between the browser and your computer (inputs are deleted after 24 hours, outputs after 7 days).
When should I use Gooey or Streamlit instead of Button?
Use Gooey when you want a desktop window for yourself and already use argparse. Use Streamlit when you need an interactive page with live charts, or uploads bigger than 25 MB, and you can run or deploy a web app.
Last updated
Put your script behind a form
Button turns a script on your computer into a web form. Colleagues sign in, fill it in, press Run and download the results. Free for 1 tool and 3 people.