[Python-Dev] 'userprefs.py': Looking for help for WinXX (was Re: user dirs on Non-Unix platforms...)

Neil Hodgson nhodgson@bigpond.net.au
Wed, 31 May 2000 18:18:20 +1000


> Using a place on the local machine of the user makes more sense to me.
>
> But excuse my ingorance: I've just 'grep'ed through the Python 1.6a2
> sources and also through Mark Hammonds Win32 Python extension c++
> sources (here on my Notebook running Linux) and found nothing called
> 'SHGetSpecialFolderPath'.  So I believe, this API is currently not
> exposed to the Python level.  Right?

   Only through the Win32 Python extensions, I think:

>>> from win32com.shell import shell
>>> from win32com.shell import shellcon
>>> shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_APPDATA)
u'G:\\Documents and Settings\\Neil1\\Application Data'
>>> shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_LOCAL_APPDATA)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: CSIDL_LOCAL_APPDATA
>>> shell.SHGetSpecialFolderPath(0, 0x1c)
u'G:\\Documents and Settings\\Neil1\\Local Settings\\Application Data'

   Looks like CSIDL_LOCAL_APPDATA isn't included yet, but its value is 0x1c.

   Neil