Slide 1

Slide 1 text

Standalone Programs using PyInstaller @JaceBrowning

Slide 2

Slide 2 text

Outline ● State of Python Packaging ● Standalone Distribution ● PyInstaller Overview ● Demonstration ● Work Time!

Slide 3

Slide 3 text

Interpreted Languages 101 ● Code ○ Modules ○ Packages ● Interpreter ○ CPython aka “Python” ○ Jython ○ IronPython

Slide 4

Slide 4 text

State of Python Packaging

Slide 5

Slide 5 text

The Pieces ● setuptools ● wheel ● twine ● pip

Slide 6

Slide 6 text

Setup Script

Slide 7

Slide 7 text

Setup Script https://packaging.python.org/distributing https://github.com/pypa/sampleproject

Slide 8

Slide 8 text

Distributions ● Built distribution ○ ○ ● Source distribution ○

Slide 9

Slide 9 text

Upload ● Python Package Index ○ https://pypi.python.org ○ https://pypi.io (“warehouse”) ● Upload distributions ○ ○

Slide 10

Slide 10 text

Standalone Distribution

Slide 11

Slide 11 text

So why do it? ● Making work tools accessible ● Sharing projects with non-programmers ● It’s fun!

Slide 12

Slide 12 text

Interpreter Embedding ● py2exe and py2app ● cx_Freeze ● PyInstaller

Slide 13

Slide 13 text

Transcompilation ● Nuitka

Slide 14

Slide 14 text

PyInstaller

Slide 15

Slide 15 text

Getting PyInstaller ● http://www.pyinstaller.org ● In general: ○

Slide 16

Slide 16 text

Getting PyInstaller ● On OS X: ○ ○ ○ ○

Slide 17

Slide 17 text

Getting PyInstaller ● On linux: ○ ○ ○ ○ ○ ○

Slide 18

Slide 18 text

Quickstart

Slide 19

Slide 19 text

Specs ● Command: ○ ● https://pyinstaller.readthedocs.io/en/stable/spec-files.html

Slide 20

Slide 20 text

Specs

Slide 21

Slide 21 text

Options ● ●

Slide 22

Slide 22 text

Options ● ●

Slide 23

Slide 23 text

Options ● ●

Slide 24

Slide 24 text

Building ● Command: ○ ● https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages

Slide 25

Slide 25 text

Compression ● UPX ● 5.8 MB:

Slide 26

Slide 26 text

Demonstration

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Now you try!