Question

Has anyone found a version of pywin32 for python 3.x? The latest available appears to be for 2.6.

Alternatively, how would I "roll my own" windows API calls in Python 3.1?

Was it helpful?

Solution

There are pywin32 available for 3.0. Python 3.1 was release two days ago, so if you need pywin32 for that you either need to wait a bit, or compile them from source.

http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063

OTHER TIPS

You should be able to do everything with ctypes, if a bit cumbersomely.

Here's an example of getting the "common application data" folder:

from ctypes import windll, wintypes

_SHGetFolderPath = windll.shell32.SHGetFolderPathW
path_buf = wintypes.create_unicode_buffer(255)
csidl = 35
_SHGetFolderPath(0, csidl, 0, 0, path_buf)
print(path_buf.value)

Result:

C:\Documents and Settings\All Users\Application Data
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top