Skip to content

PyExecGo runs Python scripts using a small, open-source Go executable, without needing Python installed.

License

Notifications You must be signed in to change notification settings

PyExecGo-Project/Template-Windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 PyExecGo Project Template for Windows

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.

🛠️ Getting Started

Follow the steps below to set up and run your Python program using PyExecGo:

Prerequisites

  • Go installed on your system (Download Go)
  • A Python program that you want to run

Installation Steps

  1. Clone the Repository

    Clone this repository to your local machine:

    git clone https://github.com/PyExecGo-Project/template.git
    cd template
  2. Organize Your Files

    Place all your Python files in the same folder as main.go.

  3. Insert the Special Sauce

    Before compiling, copy the contents of special-sauce.py and paste it at the beginning of your main.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.

  4. Edit main.go

    Open main.go and make any necessary modifications to fit your project’s needs.

  5. Build the Executable

    Build the Go executable:

    go build main.go
  6. Cleanup (Optional)

    If you wish, you can delete main.go and go.mod after building the executable to keep things tidy.

  7. 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 in requirements.txt.

📝 Notes

  • 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.

🤝 Contributing

Feel free to contribute by submitting a pull request or opening an issue.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

PyExecGo runs Python scripts using a small, open-source Go executable, without needing Python installed.

Topics

Resources

License

Stars

Watchers

Forks