I would like to have a way to read metadata from files, (like album, or artist, or date modified) in Python 3.8
I tried a suggestion from StackOverflow; Reading metadata with Python
Output from Python terminal:
Specs:
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
(on Windows 10)
and I was running it from my Downloads folder.
Whelp!
>>> import win32com.client
>>> sh = win32com.client.gencache.EnsureDispatch('Shell.Application',0)
>>> ns = sh.NameSpace(r"directory")
>>> colnum = 0
>>> columns = []
>>> while True:
... colname = ns.GetDetailsOf(None, colnum)
... if not colname:
... break
... columns.append(colname)
... colnum += 1
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
AttributeError: 'NoneType' object has no attribute 'GetDetailsOf'
I Googled the error message and got nothing about this exact problem.
Could someone help me get this code working or find an alternative to this method that works?