The code below works if I type it in just now opened python console, but not if I run it from file (there are no other code in this file)
import wnck
screen = wnck.screen_get_default()
wnck.window_get(58720313L).activate(9999999999)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s because there are events in the queue; the StackOverflow question python wnck not returning any data until after a pdb.set_trace() explains this. You just have to wait for the window list to fill up; when it is run fron the console, I believe Python empties the queue, but when you’re running a file, you have to run the gtk iteration functions.