Python for low-level Windows programming

Tim Golden mail at timgolden.me.uk
Thu Apr 3 03:56:31 EDT 2008


haxier wrote:
> I've some experience with Python in desktop apps, but now I'm looking
> to code a tool like Kee-Pass[1] which must have access to some low-
> level primitives in a windows environment: hooks when windows are
> displayed, automatic form fill, and so on in a variety of scenarios
> (desktop apps, web-based apps, citrix...)
> 
> Is this possible without too much pain? I know I can code it with C#
> or C++ but tha'ts a road to avoid, if possible.

Well of course I don't know exactly what you'd need, but the
answer's certainly Yes :) In short, even native Python comes
with the ctypes module which will let you call -- with only
a little working out the structures -- into any Windows DLL
or COM interface (the latter via the comtypes extension).

But in any case the pywin32 packages and various other
open source projects have already done a lot of the work
for you. Plus it's easy enough to write your own extension
which does the dirty work in C and exposes it to Python as
functions, objects or whatever suits your purposes.

Good luck!

TJG



More information about the Python-list mailing list