How can i extract files using custom names with zipfile module from python? – Education Career Blog

I want to add suffix to names of my files, for example uuid. How can i extract files using zipfile and pass custom names?

,

Use ZipFile.open() to open a read-only file-like to the file data, then copy it to a write-only file with the correct name using shutil.copyfileobj().

,

Step 1: Extract the files.

Step 2: Rename them.

Leave a Comment