aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: d248b1d6ef5f12656531fb6948ffe003c935faac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

   

pyzipper

A small tool to package up a Python program and associated data files as a single executable zip file.

All the facilities for this are already built into Python, this script just ties it all together with a bow.

demo1 and demo2 are two trivial sample packages.

Tested with both Python 2 and Python 3, should work with either.

How it works

This relies on two somewhat obscure Python features:

  • The zipfile.PyZipFile class's ability to construct an executable ZIP file and populate it with Python modules, packages, and data; and

  • Python's ability to treat a zip file as equivalent to a directory tree on import.

demo1 takes advantage of a third obscure feature: the pkgutil library's ability to load data files via the import system.