Get the source, compress it, and create a packed file.
(path)
| 23 | print('Usage: {} <filename>'.format(os.path.basename(sys.argv[0]))) |
| 24 | |
| 25 | def pack(path): |
| 26 | "Get the source, compress it, and create a packed file." |
| 27 | data = read_file(path) |
| 28 | builder, data = optimize(data) |
| 29 | with open(os.path.splitext(path)[0] + '.pyw', 'w') as file: |
| 30 | builder(os.path.basename(path), base64.b64encode(data), file) |
| 31 | |
| 32 | def read_file(path): |
| 33 | "Read the entire file content from path in binary mode." |
no test coverage detected