Why is the next code not working? I cant find why.
import mimetypes
import glob, urllib
for file in glob.glob("C:\\Users\\joey\\Desktop\\school\\ICOMMH"):
url = urllib.pathname2url(file)
print(file, mimetypes.guess_type(url))
The error message I get is:
AttributeError: 'module' object has no attribute 'pathname2url'
I am trying display all file typs of a directory. Is this a good way? Or is there a better way. I dont want to use the module magic.