iTranslated by AI
A New Way to Distribute Python Scripts Beyond EXE: Leveraging Tauri and Python
Nice to meet you, I'm Ray!
I work in design within the construction industry while also pursuing personal development projects. My recent dilemma is that I'm sleep-deprived from lack of time, but I'm having too much fun to stop.
The Story Behind the Development
The construction industry is in the midst of a DX boom. Riding that wave, we recently received the go-ahead to install Python.
Having worked on business improvements through various means like VBA and GAS, I, of course, have been studying Python as well. However, while Python can do almost anything, it faces the hurdle of distribution.
As is often mentioned in every article on this topic:
- Environment setup is difficult for non-engineers
- Converting to an .exe with PyInstaller is a hassle to maintain and results in slow execution
- Google Colab cannot access local files directly—this is a limitation
These are the challenges that always plague the distribution of Python scripts.
To overcome these barriers, I developed Pybes (a portmanteau of Python and Vibes), a desktop app that embeds an Embeddable Python, allowing Python scripts to be executed without installation. Scripts can be easily distributed via import/export.
The tech stack is Tauri + React. I chose not to use Electron because embedding Python plus multiple libraries would make the app size bloated, and also because Rust's execution speed is faster. In reality, I stuffed so many Python libraries into it that it's just under 600MB, though...
Approaches Taken with Pybes
Pybes is an application aimed at allowing even non-engineers to execute Python. I've taken several approaches from a non-engineer's perspective.
The Problem of Getting Stuck on Environment Setup
For non-engineers, the terminal is the stuff of nightmares. They don't understand terms like pip or npm, and they've only ever seen that black screen in movies. As I mentioned at the beginning, by embedding a Python execution environment, it is possible to set up the environment just by installing the app. While I have deferred implementing this for the beta release, the app does not currently support specifying Python versions or adding/removing libraries. It is a design decision based on my approach: non-engineers just want something that works.
The Problem of Scattered Scripts
Show me your desktop. It's probably a mess, right? It's okay, I can't show you mine either.
Jokes aside, aren't the .py files you've created scattered all over the place? Some people might be organizing them by creating specific directories. While those efforts are not bad, in Pybes, you can use SQLite to manage scripts centrally within the app. While the focus might be slightly different for a non-engineer-oriented approach, the essence is the same in terms of management.

List Management Screen
You can manage the contents registered in the DB through the front-end UI.
The Problem of "Passing Arguments is Too Hard"
For non-engineers, passing arguments when executing a script is likely the second most difficult thing after writing code. Pybes is an application that allows you to link a GUI by passing values set in the settings fields (GUI) as JSON to the script at runtime.

A look at script execution in progress
The actual code for this script is as follows. The input value from the settings field on the right is passed as an argument at runtime by the app side using sys.argv[1].
import sys
import json
with open(sys.argv[1], encoding="utf-8") as f:
inputs = json.load(f)
runtimeText = inputs["Settings Field (at runtime)"]
fixedText = inputs["Settings Field (fixed)"]
print(runtimeText)
print(fixedText)
The variable name used to store the JSON can be anything, but by using inputs as the variable name, the app can automatically read the keys within it and import them back into the settings fields.
Our Strong Ally: LLMs
Although the environment is there, it is a common fact of life that few people can write scripts. My approach to this is using chat AI. By copying a prompt adjusted for the app, pasting it into a chat AI, and writing what you want to do, you get a decent script. You can have scripts created based on the "vibes" that are also the origin of Pybes' name. The prompts still have room for improvement. While there are methods to prepare a server and use API integration to complete everything within the app, it is financially difficult with the running costs of a personal development project, so I settled on this form.
Conclusion
Pybes is the second app I've created, following Genba Dentaku. I'd like to write another article about it, but I also operate a calculation tool site focused on the construction industry. It is still in the beta release stage, but I hope to sell the app once I see the reaction. I would be happy if you found it even slightly interesting.
Feedback from engineers is exactly what I'm looking for the most right now. I'm waiting for any kind of response!
Discussion