You wrote a Python script that automates rebar scheduling from ETABS output. It works perfectly on your machine. But when you send it to a colleague, they do not have Python installed. Or they have the wrong version. Or they are missing a library. The script that saves you hours every week is useless to anyone else on the team.
Packaging your script as a portable EXE solves this completely. The recipient double-clicks a file, and it runs. No installation, no dependencies, no configuration.
For Python scripts, three tools dominate:
Install PyInstaller, navigate to your script's directory, and run the command with the --onefile flag to create a single EXE. Add --windowed if your script has a GUI to hide the console window. The output appears in a dist folder, ready to distribute.
A command-line script works for technical users, but a GUI makes your tool accessible to everyone. Python's tkinter library creates functional interfaces with minimal code. Use labeled input fields, dropdown menus for standard options, and a clearly labeled "Calculate" button. Display results in a text area or table widget.
If your script references external files — lookup tables, icons, configuration files — bundle them into the EXE using PyInstaller's --add-data flag. Access them at runtime using the sys._MEIPASS path for bundled resources or the script directory for external configuration.
Always test the EXE on a clean machine — one that does not have Python or your development libraries installed. Virtual machines or a colleague's laptop work well for this. Test every input combination, every edge case, and every file operation. Bugs that never appeared during development often surface in the packaged version because file paths and library loading work differently.
Share the EXE through your company's shared drive, internal portal, or a simple download page. Include a version number in the filename or an About dialog. When you release updates, increment the version and notify users. For more sophisticated distribution, consider an auto-update mechanism that checks a URL for the latest version on startup.
# Python tkinter: quick beam check tool
import tkinter as tk
def check_beam():
b = float(ent_b.get())
d = float(ent_d.get())
fc = float(ent_fc.get())
fy = float(ent_fy.get())
As = float(ent_as.get())
Mu = float(ent_mu.get())
a = (As * fy) / (0.85 * fc * b)
phi_mn = 0.9 * As * fy * (d - a / 2) / 1e6
status = 'PASS' if phi_mn >= Mu else 'FAIL'
lbl_result.config(text=f'phiMn={phi_mn:.2f} kN-m | {status}')
root = tk.Tk()
root.title('Beam Capacity Check')
labels = ['b(mm)','d(mm)','fc(MPa)','fy(MPa)','As(mm2)','Mu(kN-m)']
entries = []
for i, lb in enumerate(labels):
tk.Label(root, text=lb).grid(row=i, column=0)
e = tk.Entry(root); e.grid(row=i, column=1)
entries.append(e)
ent_b, ent_d, ent_fc, ent_fy, ent_as, ent_mu = entries
tk.Button(root, text='Check', command=check_beam).grid(row=6, columnspan=2)
lbl_result = tk.Label(root, text='', font=('Arial',12))
lbl_result.grid(row=7, columnspan=2)
root.mainloop()
Our ChatGPT-Assisted Portable EXE Apps seminar teaches this complete process. Register at RHCES today.
Explore RHCES Store →