Skip to content
Advertisement

Tag: python-zipfile

How can I open a folder with argparse

I want to open a folder containing x zipfiles. I have this code: But I get error code: PermissionError: [Errno 13] Permission denied: ‘Test’ I would like the zipfiles in the folder to be listed in an array when I run the code. Answer I’m not sure why you’re getting a permission error, but using open on a directory won’t

How to avoid subfolders creation while zipping files?

I am trying to zip the files from the list localpath_list in to one zip file `reports.zip. It works as expected, but when I extract the reports.zip file, there are folders created inside it. i.e all the .xls files are under files/sample/. what I need is just the .xls files without any folder structure. Answer According to: [Python.Docs]: zipfile –

Advertisement