Encountering Some Python Trickery

Sergei
Sergei
Apr 29 · 4 min read
Image for post
Image for post
[From Readwrite.com]
Image for post
Image for post
$ python script.py
is process alive? False
is process alive? True
Image for post
Image for post
Image for post
Image for post
def handle_chld(signum, frame):
os.waitpid(-1, os.WNOHANG)
proc.is_alive()
returncode = self._popen.poll()
pid, sts = os.waitpid(self.pid, flag)
$ python script.pyException: BOOM!
Is process alive? False
Is process alive? True

Pipedrive Engineering

Stories from the developers at Pipedrive and developers who…

Sergei

Written by

Sergei

Software Engineer. Senior Backend Developer at Pipedrive. PhD in Engineering. My interests are IT, High-Tech, coding, debugging, sport, active lifestyle.

Pipedrive Engineering

Stories from the developers at Pipedrive and developers who work with Pipedrive

Sergei

Written by

Sergei

Software Engineer. Senior Backend Developer at Pipedrive. PhD in Engineering. My interests are IT, High-Tech, coding, debugging, sport, active lifestyle.

Pipedrive Engineering

Stories from the developers at Pipedrive and developers who work with Pipedrive

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store