[Tutor] identifying if a path is heading into a zip file - windows

Nathan Smith nathan-tech at hotmail.com
Sat Mar 19 22:13:52 EDT 2022


Take a path, for instance:

path="c:\my folder"


  os.path.isdir(path) = True


Take a second path:

path= 'c:\my folder\a file.zip\a folder in the zip'


Is there a way for python to know, without me physically breaking it 
down, that that path is in a zip file?

For instance, a way for it to know it's dealing with a zip archive file, 
and not just a folder with .zip in the name?


thanks

-- 

Best Wishes,

Nathan Smith, BSC


My Website: https://nathantech.net




More information about the Tutor mailing list