[python-win32] finding pythonXX.dll?

Bill Janssen janssen at parc.com
Tue May 4 20:31:34 CEST 2010


Thomas Heller <theller at ctypes.org> wrote:

> Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from ctypes import *
> >>> buf = create_string_buffer(256)
> >>> windll.kernel32.GetModuleFileNameA
> <_FuncPtr object at 0x00B44B70>
> >>> import sys
> >>> windll.kernel32.GetModuleFileNameA(sys.dllhandle, byref(buf), 256)
> 32
> >>> buf.value
> 'C:\\WINDOWS\\system32\\python26.dll'
> >>>

Excellent -- just what I need!  Thanks.

Bill


More information about the python-win32 mailing list