[python-win32] Walking the shell namespace in Python

Thomas Heller theller at ctypes.org
Fri May 7 12:00:44 CEST 2010


Thomas Heller schrieb:
[...]
> 
> What I find strange if this:
What I fond strange is this:
> 
>>>> desktop.GetDisplayNameOf(pidl, SHGDN_FORPARSING)
> u'C:\\Python26\\Lib\\site-packages'
>>>> desktop.GetDisplayNameOf(pidl, SHGDN_NORMAL)
> u'Python26'
>>>>
> 
> I would have expected that the last command would have returned
> 'site-packages' instead of 'Python26'.  But I can probably work around
> it by doing a little parsing on the output of SHGDN_FORPARSING myself.
> 

Addendum:

SHGetFileInfo() is able to retrive the string that I expected:

>>> name = desktop.GetDisplayNameOf(pidl, SHGDN_FORPARSING)
>>> SHGetFileInfo(name, 0, SHGFI_DISPLAYNAME)
(1L, (0, 0, 0, 'site-packages', ''))
>>>

-- 
Thanks,
Thomas



More information about the python-win32 mailing list