🪐 PyInstaller Guide 🪐
This repository explains how to use PyInstaller to convert Python scripts into standalone executables (.exe files).
With PyInstaller, you can secure and distribute your Python programs with ease.
📀 Example Scripts 📀
Here are some example scripts that demonstrate how PyInstaller works:
hello_world.py
This is a simple Python script that prints "Hello, World!" to the console.
print("Hello, World!")
complex_script.py
This is a more complex script that could include external dependencies and requires additional considerations when converting to an executable.
import sys
def main():
print(f"Arguments: {sys.argv}")
if __name__ == "__main__":
main()
🛠️ How to Convert a Python Script to an Executable 🛠️
Follow these steps to convert your Python script into an executable:
Navigate to the directory containing your script:
cd path/to/your/script
Run PyInstaller to create the executable:
pyinstaller --onefile hello_world.py
🔒 PyInstaller Settings 🔒
--key Setting
The `--key` setting in PyInstaller is used for encryption. It specifies a key to encrypt the content of the bundled executable.
This can be useful if you need to protect the source code or sensitive data.
pyinstaller --onefile --key YOUR_SECRET_KEY your_script.py
In this command, `YOUR_SECRET_KEY` is a string you provide. PyInstaller will use this key to encrypt the content of the executable, making it harder to reverse-engineer.
README.md inspired by https://github.com/billythegoat356/