Looking for tips and gotchas for working with Python 3.5 zipapp feature

Malcolm Greene python at bdurham.com
Fri Sep 16 19:48:00 EDT 2016


Looking for tips or edge case gotchas associated with using Python 3.5's
new zipapp feature. For those of you wondering what this feature is, see
the end of this post for a brief background [1].

Two questions in particular:

1. Are there any issues with deploying scripts that sit in sub-
   folders beneath the directory being zipped, eg. does zipapp only
   support a flat folder of scripts or does it recursively zip and
   path sub-folders?

2. Can additional non-Python files like config files be added to a
   zipapp without breaking them and if so, how would your script
   reference these embedded files (by opening up the zipapp as a zip
   archive and navigating from there?).

Thank you,
Malcolm

[1] The zipapp feature of Python 3.5 is pretty cool: It allows you to
    package your Python scripts in a single executable zip file. This
    isn't a replacement for tools like PyInstaller or Py2Exe, eg. it
    doesn't bundle the Python interpreter in the zip file, but it's a
    clean way to distribute multi-file scripts in environments where you
    have control over users' Python setups.

Here's the manual page:

zipapp — Manage executable python zip archives
https://docs.python.org/3/library/zipapp.html




More information about the Python-list mailing list