Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Standalone Python Programs using PyInstaller

Standalone Python Programs using PyInstaller

A talk on Python packaging and PyInstaller given at GRPUG.

Eff2cdaa8474520ed29ebc38031fab87?s=128

Jace Browning

September 19, 2016
Tweet

Transcript

  1. Standalone Programs using PyInstaller @JaceBrowning

  2. Outline • State of Python Packaging • Standalone Distribution •

    PyInstaller Overview • Demonstration • Work Time!
  3. Interpreted Languages 101 • Code ◦ Modules ◦ Packages •

    Interpreter ◦ CPython aka “Python” ◦ Jython ◦ IronPython
  4. State of Python Packaging

  5. The Pieces • setuptools • wheel • twine • pip

  6. Setup Script

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

  8. Distributions • Built distribution ◦ ◦ • Source distribution ◦

  9. Upload • Python Package Index ◦ https://pypi.python.org ◦ https://pypi.io (“warehouse”)

    • Upload distributions ◦ ◦
  10. Standalone Distribution

  11. So why do it? • Making work tools accessible •

    Sharing projects with non-programmers • It’s fun!
  12. Interpreter Embedding • py2exe and py2app • cx_Freeze • PyInstaller

  13. Transcompilation • Nuitka

  14. PyInstaller

  15. Getting PyInstaller • http://www.pyinstaller.org • In general: ◦

  16. Getting PyInstaller • On OS X: ◦ ◦ ◦ ◦

  17. Getting PyInstaller • On linux: ◦ ◦ ◦ ◦ ◦

  18. Quickstart

  19. Specs • Command: ◦ • https://pyinstaller.readthedocs.io/en/stable/spec-files.html

  20. Specs

  21. Options • •

  22. Options • •

  23. Options • •

  24. Building • Command: ◦ • https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages

  25. Compression • UPX • 5.8 MB:

  26. Demonstration

  27. None
  28. Now you try!