Tuesday, March 24, 2009

Python mouse move in 5 lines of code (Linux only)

from Xlib import X, display
d = display.Display()
s = d.screen()
root = s.root
root.warp_pointer(300,300)
d.sync()

7 comments:

  1. Foi quase um import linux.... hehhehe
    E da-lhe python!
    Abraço!
    posted from my kubuntu 8.10!

    ReplyDelete
  2. Anonymous2:53 PM

    Precisei adicionar um:

    d.sync()

    ao final para que funcionasse.

    ReplyDelete
  3. Opa, corrigido, obrigado :)

    ReplyDelete
  4. Anonymous8:20 AM

    Thanks for sharing...Google

    ReplyDelete
  5. Hola Daniel, necesito contactarme contigo para hablar sobre GPUCV, soy Marcelo Pistarelli de Facultad de Ingeniería de Rosario, Argentina

    ReplyDelete
  6. Please, can you get me at danielbaggio at the gmail dot com?

    ReplyDelete
  7. Anonymous1:37 PM

    you have a nice site. thanks for sharing this enormous resources. keep it up. anyway, various kinds of ebooks are available here

    http://feboook.blogspot.com

    ReplyDelete