Skip to content

Instantly share code, notes, and snippets.

@romainGuiet
Last active October 29, 2019 13:32
Show Gist options
  • Save romainGuiet/e590092c2924a17e2e9790800ab42328 to your computer and use it in GitHub Desktop.
Save romainGuiet/e590092c2924a17e2e9790800ab42328 to your computer and use it in GitHub Desktop.
Export zip file content in current working directory
archive_name = "models.zip"
import os
import zipfile
# retrieve the pat of the current directory (bash command uses !...)
path=!pwd
path = path[0]
# create the archive path using path and archive_name
archive_path = os.path.join(path,archive_name)
if ( zipfile.is_zipfile(archive_path) ):
print( "extract : "+ archive_name )
#zf=zipfile.ZipFile(image_archive_name, 'r', allowZip64=True)
zf = zipfile.ZipFile(archive_path, 'r')
zf.extractall()
print("Zip extraction: DONE")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment