From a59e6376f5b4b7f71c9c0826dcbb1b3b2e7ae778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 14 Jul 2020 18:58:13 +0200 Subject: [PATCH] PyInstaller --- README.md | 12 ++++++++++++ index.html | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 748c8ab..dbfcca7 100644 --- a/README.md +++ b/README.md @@ -3455,6 +3455,18 @@ cdef enum : , , ... ``` +PyInstaller +----------- +```bash +$ pip3 install pyinstaller +$ pyinstaller script.py # Compiles into './dist/script' directory. +$ pyinstaller script.py --onefile # Compiles into './dist/script' console app. +$ pyinstaller script.py --windowed # Compiles into './dist/script' windowed app. +$ pyinstaller script.py --add-data ':.' # Adds file to the root of the executable. +``` +* **Paths of files have to be changed to `'os.path.join(sys._MEIPASS, "")'`.** + + Basic Script Template --------------------- ```python diff --git a/index.html b/index.html index e99b60d..e1a7a05 100644 --- a/index.html +++ b/index.html @@ -2930,6 +2930,16 @@ cdef <type/void> <func_name>(<type> <arg_name_1>, ...):
cdef enum <enum_name>: <member_name_1>, <member_name_2>, ...
 
+

#PyInstaller

$ pip3 install pyinstaller
+$ pyinstaller script.py                        # Compiles into './dist/script' directory.
+$ pyinstaller script.py --onefile              # Compiles into './dist/script' console app.
+$ pyinstaller script.py --windowed             # Compiles into './dist/script' windowed app.
+$ pyinstaller script.py --add-data '<path>:.'  # Adds file to the root of the executable.
+
+ +
    +
  • Paths of files have to be changed to 'os.path.join(sys._MEIPASS, "<path>")'.
  • +

#Basic Script Template

#!/usr/bin/env python3
 #
 # Usage: .py