Note: The PyZipFile class doesn’t compress your Python modules and packages by default. writepy() out, say that you have a hello.py module: py file down to bytecode and add the resulting. In this section, you’ll use PyZipFile.writepy() to compile a. In the following two sections, you’ll get your hands dirty and start creating your own importable ZIP files containing modules and packages. You’ll learn more about this topic in upcoming sections. py files makes the importing process way more efficient by skipping the compilation step. pyc files and then added to the target archive. If optimize is -1, its default value, then the input. writepy(), which accepts a Python module or package as an argument and adds it to a target ZIP file.
0 Comments
Leave a Reply. |