use os.kill(pid, 0) instead of ps to check process
Merge pull request #1 from romuald/master

Use os.kill(pid, 0) to check process