Python รัน Zip File ได้โดยตรง (Python 2.6+)
1. Zip App (Built-in)
$ zip -r my_app.zip . -i *.py
$ echo "import main; main()" > __main__.py
$ zip my_app.zip __main__.py
$ python my_app.zip
2. Stickytape (รวม Script + Deps เป็น 1 ไฟล์ .py)
$ pip install stickytape
$ stickytape scripts/sample --add-python-path . > sample-standalone.py
# หรือ
$ stickytape scripts/sample --add-python-path . --output-file sample-standalone.py
3. Tools อื่นสำหรับ Distribution
- PyInstaller - Build Executable (Windows .exe, Linux Binary, macOS .app)
- cx_Freeze - คล้าย PyInstaller
- Nuitka - Compile Python → C → Binary (Performance)
- shiv / pex - Zip App With Dependencies (Runnable Zip)
เลือกไหนดี? Script เล็ก → Stickytape | App ใหญ่ → PyInstaller/Shiv | Performance Critical → Nuitka