473,236 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 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 1760
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

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
28
by: Matt Leslie | last post by:
Hi, I'm trying to use microthreads under stackless python, since they sound like exactly what I am after, but I am having very little success. I've got a fresh install of python 2.3.3 from...
37
by: michele.simionato | last post by:
Paul Rubin wrote: > How about macros? Some pretty horrible things have been done in C > programs with the C preprocessor. But there's a movememnt afloat to > add hygienic macros to Python. Got any...
267
by: Xah Lee | last post by:
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at...
852
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.