471,356 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Python Macros

By "Python Macros" I mean automation in Python. I've looked around and google-searched aplenty, but have not been able to find a way to do the following things in Python:

-Moving the mouse to an x,y location on the screen

-Finding a color or specific bmp image on the screen

Is there any way to do this? If it's possible, could anyone explain or give me a link to how?

This would be very helpful, because if it won't work in Python, my idea is out the window and I'll have to do it in another language ;)

I am running Windows Vista (ick), but I think it should be OS-independent since python is interpreted.
Jun 17 '07 #1
4 1617
bartonc
6,596 Expert 4TB
By "Python Macros" I mean automation in Python. I've looked around and google-searched aplenty, but have not been able to find a way to do the following things in Python:

-Moving the mouse to an x,y location on the screen

-Finding a color or specific bmp image on the screen

Is there any way to do this? If it's possible, could anyone explain or give me a link to how?

This would be very helpful, because if it won't work in Python, my idea is out the window and I'll have to do it in another language ;)

I am running Windows Vista (ick), but I think it should be OS-independent since python is interpreted.
The answer may depend greatly on which GUI Toolkit you are using. I know that wxPython (my preferred toolkit) has a Zoom() function to move the cursor to a screen location and can get (pretty much) any property of any object on the screen. If you are using Tkinter, you'll find many limitations, but I'm not sure about both of those in your query.
Jun 17 '07 #2
The answer may depend greatly on which GUI Toolkit you are using. I know that wxPython (my preferred toolkit) has a Zoom() function to move the cursor to a screen location and can get (pretty much) any property of any object on the screen. If you are using Tkinter, you'll find many limitations, but I'm not sure about both of those in your query.
wxPython is what I need it for :D
Jun 17 '07 #3
bartonc
6,596 Expert 4TB
wxPython is what I need it for :D
I know that I've seen it. Can't seem to find it at the moment. I though it was called Zoom() (I remember thinking that it was such a terrible name for a function that moved the cursor). I'll keep looking, though.
Jun 18 '07 #4
bartonc
6,596 Expert 4TB
By "Python Macros" I mean automation in Python. I've looked around and google-searched aplenty, but have not been able to find a way to do the following things in Python:

-Moving the mouse to an x,y location on the screen

-Finding a color or specific bmp image on the screen

Is there any way to do this? If it's possible, could anyone explain or give me a link to how?

This would be very helpful, because if it won't work in Python, my idea is out the window and I'll have to do it in another language ;)

I am running Windows Vista (ick), but I think it should be OS-independent since python is interpreted.
I've been thinking about your task. It seems to me that moving the cursor to a spot on the screen is not what you want. I'm picturing more of an animated graphic moving in a timed manner to "click" the menu, etc. which gets activated programmatically. Otherwise, you may want to think about generating mouse move events to fool the UI into thinking that the mouse is being moved.
Jun 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
699 posts views Thread by mike420 | last post: by
28 posts views Thread by Matt Leslie | last post: by
37 posts views Thread by michele.simionato | last post: by
267 posts views Thread by Xah Lee | last post: by
852 posts views Thread by Mark Tarver | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.