Is there a Python equivalent to Java's AWT Robot class?

11,291

Solution 1

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.

Solution 2

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

Share:
11,291
Stuart K
Author by

Stuart K

Updated on June 05, 2022

Comments

  • Stuart K
    Stuart K almost 2 years

    Does anyone know of a Python class similar to Java Robot?

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

  • Stuart K
    Stuart K about 15 years
    Thanks very much, this is exactly what I was looking for.
  • Stuart K
    Stuart K about 15 years
    Thanks Benji, I'll be having a look at this as well.
  • Jamie
    Jamie over 8 years
  • rsarro
    rsarro over 5 years
    RobotFramework can be used outside of web automation. Selenium is just one of the drivers