diff --git a/README.md b/README.md index 748c8ab..dbfcca7 100644 --- a/README.md +++ b/README.md @@ -3455,6 +3455,18 @@ cdef enum <enum_name>: <member_name_1>, <member_name_2>, ... ``` +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 '<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 --------------------- ```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>, ...): </code></pre> <pre><code class="python language-python hljs">cdef enum <enum_name>: <member_name_1>, <member_name_2>, ... </code></pre> +<div><h2 id="pyinstaller"><a href="#pyinstaller" name="pyinstaller">#</a>PyInstaller</h2><pre><code class="bash language-bash hljs">$ pip3 install pyinstaller +$ pyinstaller script.py <span class="hljs-comment"># Compiles into './dist/script' directory.</span> +$ pyinstaller script.py --onefile <span class="hljs-comment"># Compiles into './dist/script' console app.</span> +$ pyinstaller script.py --windowed <span class="hljs-comment"># Compiles into './dist/script' windowed app.</span> +$ pyinstaller script.py --add-data <span class="hljs-string">'<path>:.'</span> <span class="hljs-comment"># Adds file to the root of the executable.</span> +</code></pre></div> + +<ul> +<li><strong>Paths of files have to be changed to <code class="python hljs"><span class="hljs-string">'os.path.join(sys._MEIPASS, "<path>")'</span></code>.</strong></li> +</ul> <div><h2 id="basicscripttemplate"><a href="#basicscripttemplate" name="basicscripttemplate">#</a>Basic Script Template</h2><pre><code class="python language-python hljs"><span class="hljs-comment">#!/usr/bin/env python3</span> <span class="hljs-comment">#</span> <span class="hljs-comment"># Usage: .py</span>