How to get a window ID in linux using python?

Sandy dksreddy at gmail.com
Wed Jun 3 04:25:23 EDT 2009


Hi all,
Is there a way to get window ID in linux using python by just using
the window name (say 'VPython')?
This can be done in (Microsoft) windows (got it from somewhere else,
not tested).
    import win32gui
    self.VP = win32gui.FindWindow ( None, 'VPython' )

In Linux, we can get window info by executing 'xwininfo' and then
selecting the desired window manually. Can this be done automatically
in python?

Thanks,
Sandy





More information about the Python-list mailing list