[Tutor] Mouse clicking

Alan Gauld alan.gauld at btinternet.com
Sun Jul 1 01:21:26 CEST 2007


"elis aeris" <hunter92383 at gmail.com> wrote in

> It's very cryptic to me and more or less is not explained in any 
> python
> tutorials.
>
> http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=mouse_event
> http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=keybd_event
> http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=GetFocus

It wouldn't be in a Python tutorial because its all about the Windows
API and few Python programmers get involved with Windowes at
that level. It can be done using PyWin32 but that is just a wrapper
around the Windows C functions. You need to understand how
they work (And Microsoft documentation is notoriously poor)

Personally I do most of my low level Windows work using Borlands
Delphi or C++Builder and use a couple of books on those tools along
with the MS Help files. But the Python wrapper should work just as 
well.

But, normally, a python programmer will step back and try to write a 
program
that does what is needed directly in Python using a high level module
rather than calling OS API calls directly. (Thus is true in Unix as 
well
as Windows)

So rather than try to robotically control Notepad say, its easier to
write a Python program to edit the text file directly.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
(Which sadly seems to be down at the moment!)




More information about the Tutor mailing list