def pidExists(pid): process_listing = commands.getoutput('ls /proc').split('\n') return str(pid) in process_listing