How to make Windows API calls in Python 3.1?

Has anyone found a pywin32 version for python 3.x? The latter is available for version 2.6.

Alternatively, how would I “minimize my own” calls to the Windows API in Python 3.1?

+5
source share
2 answers

There is pywin32 for 3.0. Python 3.1 was released two days ago, so if you need pywin32, you need to either wait a bit or compile them from the source.

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

+5
source

You can do everything with ctypes if a little cumbersome.

" ":

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)

:

C:\Documents and Settings\All Users\Application Data
+8

All Articles