473,406 Members | 2,439 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,406 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 1769
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.