Button guide
Let people use your Python script without getting the source code obfuscation, compiling, or keeping it on your computer behind a form
If you bundle your Python script with PyInstaller, compile it with Nuitka, or obfuscate it with PyArmor, you still have to put the program file on the other person's computer, where it can be reversed with enough effort. If you keep the script on your own computer behind a Button form at button.bitgate.dev, your colleagues or clients only get a web form and the results, never the .py file or a binary. Button's Free plan is $0 for 1 published tool, up to 3 invited people, and 100 runs per month, and each run can run for up to 30 minutes with files up to 25 MB each.
Why obfuscation and compilation don't fully hide your code
When someone asks how to hand out a Python script without giving away the source, the usual suggestions are PyInstaller, Nuitka, or PyArmor. They all solve a real problem, which is getting a script to run on someone else's machine without handing over a plain .py file, and they're fine if you just want to stop casual editing. None of them stop a determined user from getting your logic back, because the program still has to run on their hardware.
PyInstaller bundles the Python interpreter, your script and your dependencies into a folder or a single executable. With --onefile, that executable unpacks everything into a temporary _MEI folder every time the program starts, so your code sits on their disk while it runs. You also run into two practical headaches: PyInstaller does not cross-compile, so you build the Windows .exe on Windows and the macOS app on a Mac, and antivirus false positives are a known PyInstaller issue.
Nuitka goes further by translating your Python code into C and compiling it into a native executable. That makes it harder to pull apart than bundled bytecode, but the compiled binary still sits on your client's computer, and like PyInstaller, Nuitka does not cross-compile.
PyArmor takes the obfuscation route instead. It scrambles your Python scripts before you hand them out. The free trial can't obfuscate large scripts, and paid licenses start at $52 one-time for the Basic license. Even with paid obfuscation, the obfuscated files ship to and run on the user's machine, so the code and any keys or logic inside it are in their hands.
Keeping the script on your own computer with Button
If you don't want the file on their computer at all, don't send them the file.
Button (https://button.bitgate.dev) turns a script sitting on your computer into a web form that your colleagues or clients can run from their browser. It works with Python, and also Node, R, PowerShell, shell scripts, or compiled binaries. When someone fills in the form and presses Run, the job executes on your computer, never in Button's cloud. They get a form and the output files, never the script file.
Here is how you set a script up:
- Rewrite the script so it takes its inputs as command-line arguments instead of hard-coded paths or
input()prompts. In Python, useargparse(the same idea ascommandArgs()in R, aparam()block in PowerShell, or$1and$2in bash). Take each input file path as an argument, and write the output files into an output folder whose path is also passed in as an argument.
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--input-file", required=True)
parser.add_argument("--currency", default="USD")
parser.add_argument("--output-dir", required=True)
args = parser.parse_args()
- Sign in at button.bitgate.dev and install the Button runner on your computer (macOS, Linux, or Windows) using the one-line command the site shows you - it's a
curlcommand on macOS and Linux, and PowerShell on Windows. - Open the local setup page, pick your Python program, and describe its inputs. You can set up fields for text, number, yes/no, choice, and files. Fixed flags like
--currencyare part of the command you approve on your machine; the people using the form only supply the values for the fields. - Publish the tool. Button gives it its own page and sends invite emails to the people you choose.
- Your colleagues or clients 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.
On the security side, the runner on your computer only executes the exact command you approved, which is pinned by hash. Every value from the web form is passed to your program as its own argument with no shell involved, and a form value can't start with -, so nobody can sneak extra flags into your script. If you change the tool later, your users have to confirm the new version before they can run it. Every run is logged with who ran it and when, and you can revoke someone's access or set it to expire whenever you want.
The trade-offs (and when to use something else)
Button isn't the right answer for every setup, and you should know the trade-offs before you wire a script up to it.
First, your computer has to be turned on and online for anyone to run your tool. The tool page shows Ready, Busy, or Offline, and the runner handles one run at a time per computer. Every plan allows one computer (runner) per workspace; if you pair a new computer, it replaces the previous one.
Second, while the job runs on your computer, the form values and files pass through Button's servers to get between the user's browser and your machine. Button deletes input files 24 hours after a run ends, and deletes output files after 7 days.
Third, there are hard limits on job size: up to 8 files per run, 25 MB per file, and 100 MB total per run. A run can take at most 30 minutes, and logs are capped at 1 MB per run.
So when is PyInstaller, Nuitka, or PyArmor the better choice?
- When the person running the script needs to use it offline, on a plane, or when your computer is asleep.
- When you are selling or distributing software to thousands of people who need to run jobs at the exact same time on their own hardware.
- When the script takes longer than 30 minutes to finish, or processes local files larger than 25 MB each (or 100 MB per run).
- When the input files or outputs aren't allowed to pass through an outside relay server at all.
Comparison
| Tool | Where the script runs | What the user receives | Price | Notable limits & quirks |
|---|---|---|---|---|
| Button | Your computer (macOS, Linux, Windows) | A link to a web form and the output files | Free: $0 (1 tool, 3 people, 100 runs/mo, 1 GB transfer/mo). Pro: $15/mo or $144/yr ($12/mo) for 50 tools, 250 people, 5,000 runs/mo, 50 GB transfer/mo | Your computer must be on; 1 run at a time; max 30 min, 8 files (25 MB each, 100 MB total) per run; inputs/outputs pass through Button's servers |
| PyArmor | The user's computer | Obfuscated Python files | Free trial (small scripts only); Basic starts at $52 one-time | Code still ships to the user's machine |
| Nuitka | The user's computer | Compiled executable | Free | Does not cross-compile; binary still ships to the user's machine |
| PyInstaller | The user's computer | Bundled folder or --onefile executable |
Free | Does not cross-compile; --onefile unpacks to a temp _MEI folder on start; known antivirus false positives |
FAQ
Do my clients have to pay for a Button account or install Python?
No. Recipients never pay and they don't install anything on their computers. They just open the link from their invite email, sign in with Google or a one-time email code, and use the form in their browser.
How is the "people" limit counted on the Free and Pro plans?
The limit (3 people on Free, 250 on Pro) counts the distinct colleagues or clients you have invited. You don't count toward the people limit, though your own test runs do count toward the monthly run limit (100 runs per month on Free, 5,000 on Pro).
What happens if I downgrade from Pro back to Free?
Downgrading deletes nothing. Your tools and setup stay intact, and you just go back to the Free plan limits of 1 published tool, 3 people, 100 runs per month, and 1 GB of file transfer per month.
How long does Button keep the files my clients upload?
Form values and files pass through Button's servers on their way to and from your computer. Input files are deleted 24 hours after a run finishes, and output files are deleted after 7 days.
Can someone pass malicious flags into my Python script through the form?
No. The runner only executes the exact command you approved on your computer (pinned by hash), every form value is passed as a separate argument without a shell, and values aren't allowed to start with -.
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.