AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Windows zip file10/10/2023 Given the problem that you describe, the unzip_dir probably doesn't have any subdirectories to start with, and the program could just walk over the files in the current directory only. This handles files in any directory under the directory from where the program is started. ![]() ![]() Os.makedirs(full_dir_name) # only create if not done yet # never creates a directory if there is a parent dir with a file.įor root, dir_names, file_names in os.walk('.'):Īlt_file_name = file_name.replace('\\', '/')Īlt_file_name = alt_file_name # cut of starting dir separatorĪlt_dir_name, alt_base_name = alt_file_name.rsplit('/', 1)įull_dir_name = os.path.join(root, alt_dir_name) # already created directories, walk works topdown, so a child dir Updating: pip/ (244 bytes security) (stored 0%)Īdding: pip/pip.log (164 bytes security) (deflated 66%)īut now that you have the files with file names that contain "paths" with backslashes, you can run the following program in unzip_dir: #! /usr/bin/env python ![]() I think something went wrong with the creation of the zip file, because when I create a zip file on Windows is has (portable) forward slashes: zip.exe -r pip pip
0 Comments
Read More
Leave a Reply. |