Important: This repository is specifically for the PyExecGo project itself. If you’re not looking for the PyExecGo source code but want to build your programs or scripts with PyExecGo, take a look at our PyExecGo Builder.
PyExecGo is a simple tool that allows you to run Python programs without needing Python installed on the target machine. It uses a portable version of Python and automatically installs any dependencies listed in requirements.txt
.
Follow the steps below to set up and run your Python program using PyExecGo:
- Go installed on your system (Download Go)
- A Python program that you want to run
-
Clone the Repository
Clone this repository to your local machine:
git clone https://github.com/PyExecGo-Project/template.git cd template
-
Organize Your Files
Place all your Python files in the same folder as
main.go
. -
Insert the Special Sauce
Before compiling, copy the contents of
special-sauce.py
and paste it at the beginning of yourmain.py
(or your start script).
This code must be on line 1 of your Python script.After copying the content, you can safely delete
special-sauce.py
. -
Edit
main.go
Open
main.go
and make any necessary modifications to fit your project’s needs. -
Build the Executable
Build the Go executable:
go build main.go
-
Cleanup (Optional)
If you wish, you can delete
main.go
andgo.mod
after building the executable to keep things tidy. -
Run Your Program
You can now run your Python program using the generated
main.exe
.When you run
main.exe
, it will automatically install the dependencies listed inrequirements.txt
.
- Ensure that
requirements.txt
is present in the same folder as your Python files. - You can customize the startup process by modifying the Go code in
main.go
before building.
Feel free to contribute by submitting a pull request or opening an issue.
This project is licensed under the MIT License - see the LICENSE file for details.