Finding file details...

Kam-Hung Soh kamhung.soh at gmail.com
Fri May 30 01:03:28 EDT 2008


Kalibr wrote:
> On May 30, 1:41 am, "Roger Upole" <rup... at hotmail.com> wrote:
>> You can use the shell COM objects to access media properties
>> as shown by Explorer.
>>
>> import win32com.client
>> sh=win32com.client.Dispatch('Shell.Application')
>>
>> folder= r'M:\Music\Bob Dylan\Highway 61 Revisited'
>> ns=sh.NameSpace(folder)
>>
>> ## the column index for Artist may vary from folder to folder
>> for c in range(0,255):
>>     colname=ns.GetDetailsOf(None, c)
>>     if colname=='Artists':  ## This shows up as just Artist on XP
>>         for i in ns.Items():
>>             artist=ns.GetDetailsOf(i, c)
>>             if artist:
>>                 print ns.GetDetailsOf(i, 0), artist
>>         break
>>
>>             Roger
> 
> I shall give that a go. (is the module you reference this one?
> http://python.net/crew/mhammond/win32/Downloads.html )

If you installed ActiveState's Python, the win32com module should be 
installed.

-- 
Kam-Hung Soh <a href="http://kamhungsoh.com/blog">Software Salariman</a>




More information about the Python-list mailing list