zip file extractor
-
We gather from https://forum.micropython.org/viewtopic.php?t=3094 that there isn't a micropython lib for extracting .zip files. Just thought I'd check that there isn't something in the pycom version of micropython that we might use?
-
As mentioned in the thread, there is the
uzlibmodule. We tried to make some more comprehensive examples for that here: https://docs.pycom.io/tutorials/advanced/uzlib/. To answer your question, I do not think it works for normal.zipfiles, but it is able to decompresszlibandgzipfiles. -
tnx Gijs, compressed a 40k .py file with zlib in python 3.9 on my PC down to a 10k .zlib &, once I substituted uzlib for zlib in the pycom device code from the tutorial you linked, the gpy extracted it. The gzip example also extracted a .gzip file made with 7zip in Windows10 (had to use the folder name in lieu of the file name). Spoilt for choice now.
-
Great to hear it works for you as well :) There's also different options to play with for compression ratio etc, but we haven't quite figured that out
-
@Gijs I don't see any .pyc files on the gpy Gijs. Does the interpreter not make them when it interprets boot.py into ram for execution? I was thinking if I could get my hands on a .pyc version of my user code it would presumably have comments stripped out & I could upload that as an alternative to zlib or gzip?
-
Sorry I don't know what you're refering to exactly. You're looking for a compiled version of the python files on the device? I'm not sure how it works
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login