Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can it be did using Python(in Ubuntu)?

share|improve this question
You should ask on StackOverflow. There are some smart py people over there. – Chris K Jun 17 '12 at 20:31
Please check:… – Javier Rivera Jun 18 '12 at 14:15
import wnck
screen = wnck.screen_get_default()
window = screen.get_active_window()
pid = window.get_pid()
share|improve this answer
This gets the ID of the process, but not the process' name. If you know the process ID, however, you could then open the System Monitor and match the ID to the process name in the table under the "Processes" tab. – Christopher Kyle Horton Aug 7 '12 at 21:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.