Need help with TCP/IP client access from Windows

Mark Hammond MHammond at skippinet.com.au
Sat Jul 31 19:46:13 EDT 1999


Bill Tutt wrote in message
<4D0A23B3F74DD111ACCD00805F31D8100DB90FF7 at RED-MSG-50>...

>The correct way to go about doing these things is via the SHGetFolderPath
>API.
>(Calling SHGetSpecialFolderPath is also ok, but SHGetFolderPath is the
>preferred API entry point.)
>Docs at:
>http://msdn.microsoft.com/library/sdkdoc/shellcc/Shell/Functions/ShGetFolde
r
>Path.htm
>
>A description of all of the special folders is at:
>http://msdn.microsoft.com/library/sdkdoc/shellcc/shell/Functions/CSIDL.htm
>
>
>Ok so can I use these in Python yet?
>Unfortunately, not at the moment. If someone screams and yells I'm sure
Mark
>or I will write the necessary wrapping code.

Actually Bill, you can - althought it is well hidden.

There is a win32com.shell.shell extension that covers this.  It is part of
the COM extensions as all this cruft is heavily tied to COM - eg, creating
shortcuts, etc etc etc.

>>> from win32com.shell import shell, shellcon
>>> shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PERSONAL)
L'C:\\WINNT\\Profiles\\skip\\Personal'
>>>

SHGetFolderPath/Location arent exposed - I will add them - but as you
mention, the SHGetSpecial versions do work fine.

Mark.







More information about the Python-list mailing list