views:

491

answers:

5

Hi, does anyone know of a Python class similar to Java Robot?

Specifically I would like the perform a screen grab in Ubuntu, and eventually track mouse clicks and keyboard presses (although that's a slightly different question)

Thanks, Stuart

A: 

I don't but you can use Jython for that.

e-satis
A: 

As far as the screen grab, see this answer. That worked for me. Other answers to the same question might be of interest as well.

Fred Larson
+4  A: 

If you have GTK, then you can use the gtk.gdk.Display class to do most of the work. It controls the keyboard/mouse pointer grabs a set of gtk.gdk.Screen objects.

Nadia Alramli
Thanks very much, this is exactly what I was looking for.
Stuart K
+2  A: 

Check out GNU LDTP:

GNU/Linux Desktop Testing Project (GNU LDTP) is aimed at producing high quality test automation framework [...]

Especially Writing LDTP test scripts in Python scripting language

Benji York
Thanks Benji, I'll be having a look at this as well.
Stuart K
A: 

Check out the RobotFramework. I do not know if it will do the same things as JavaRobot, or if it will do more. But it is easy and very flexible to use.

rsarro