This project provides a simple way to convert Python scripts into standalone Linux binaries. It uses PyInstaller to package your Python application along with its dependencies, allowing it to run on systems without needing a Python interpreter.
- Python 3.x
- PyInstaller
-
Install Python: Make sure Python 3.x is installed on your system. You can check this by running:
python3 --version
Install PyInstaller: You can install PyInstaller using pip. Open a terminal and run:
bash Copy code pip install pyinstaller Clone this repository (if applicable): If this script is part of a larger project, you can clone the repository:
bash Copy code git clone https://github.com/yourusername/repository.git cd repository Build the Binary: Navigate to the directory containing your Python script and run:
bash Copy code pyinstaller --onefile your_script.py This will create a dist folder containing the executable.
Move the Executable to a Directory in PATH:
You can move the generated executable to a directory that is included in your PATH. For example:
bash Copy code sudo mv dist/your_script /usr/local/bin/ Or, for user-specific access:
bash Copy code mv dist/your_script ~/.local/bin/ Set Permissions: Ensure the binary is executable:
bash Copy code chmod +x /usr/local/bin/your_script Or for the local directory:
bash
Copy code
chmod +x ~/.local/bin/your_script
Update PATH (if using ~/.local/bin): If you placed your executable in /.local/bin, add it to your PATH by editing your shell configuration file (/.bashrc, ~/.bash_profile, or ~/.zshrc):
bash Copy code export PATH="$HOME/.local/bin:$PATH" Apply the changes:
bash Copy code source ~/.bashrc Usage Once the executable is in your PATH, you can run it from anywhere in the terminal:
bash Copy code your_script License This project is licensed under the MIT License. See the LICENSE file for details.
Author Jay Mee @ J~Net 2024
vbnet Copy code
- Replace
your_script.pyandyour_scriptwith the actual names of your Python script and the generated binary, respectively. - Adjust the repository URL and license information as needed.
- Feel free to add more sections, such as examples or troubleshooting tips, depending on the complexity and functionality of your script.
This README.md file provides users with all the necessary information to understand, install, and use your script effectively. If you need any modifications or additional sections, let me know!