Popular recipes tagged "pid"http://code.activestate.com/recipes/tags/pid/2015-12-18T20:59:43-08:00ActiveState Code RecipesWait for PID and check for PID existance (POSIX) (Python)
2012-04-15T14:13:02-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/578022-wait-for-pid-and-check-for-pid-existance-posix/
<p style="color: grey">
Python
recipe 578022
by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a>
(<a href="/recipes/tags/exists/">exists</a>, <a href="/recipes/tags/exit/">exit</a>, <a href="/recipes/tags/pid/">pid</a>, <a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/status/">status</a>, <a href="/recipes/tags/timeout/">timeout</a>, <a href="/recipes/tags/wait/">wait</a>).
Revision 7.
</p>
<p>Two functions: one which waits for a certain PID to terminate (with optional timeout), another one which checks whether a process with a given PID is running.</p>
<p>This was extracted from <a href="http://code.google.com/p/psutil/">psutil</a> project which also provides a Windows implementation.</p>
<p>Timeout functionality is implemented as a busy loop and it was inspired by <a href="http://bugs.python.org/issue5673." rel="nofollow">http://bugs.python.org/issue5673.</a></p>
Context manager for a daemon pid file (Python)
2013-10-07T21:03:30-07:00Graham Poulterhttp://code.activestate.com/recipes/users/4172291/http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/
<p style="color: grey">
Python
recipe 577911
by <a href="/recipes/users/4172291/">Graham Poulter</a>
(<a href="/recipes/tags/daemon/">daemon</a>, <a href="/recipes/tags/pid/">pid</a>).
Revision 3.
</p>
<p>Context manager for a pid (process id) file used to tell whether a daemon process is still running.</p>
<p>On entry, it writes the pid of the current process to the path. On exit, it removes the file.</p>
<p>Designed to work with python-daemon.</p>
Discrete PID Controller (Python)
2015-12-18T20:59:43-08:00Canerhttp://code.activestate.com/recipes/users/4114638/http://code.activestate.com/recipes/577231-discrete-pid-controller/
<p style="color: grey">
Python
recipe 577231
by <a href="/recipes/users/4114638/">Caner</a>
(<a href="/recipes/tags/controller/">controller</a>, <a href="/recipes/tags/derivative/">derivative</a>, <a href="/recipes/tags/discrete/">discrete</a>, <a href="/recipes/tags/integral/">integral</a>, <a href="/recipes/tags/pid/">pid</a>, <a href="/recipes/tags/proportional/">proportional</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>The recipe gives simple implementation of a Discrete Proportional-Integral-Derivative (PID) controller. PID controller gives output value for error between desired reference input and measurement feedback to minimize error value.
More information: <a href="http://en.wikipedia.org/wiki/PID_controller" rel="nofollow">http://en.wikipedia.org/wiki/PID_controller</a></p>
<p><strong>For new version please check:</strong> <a href="https://github.com/ivmech/ivPID" rel="nofollow">https://github.com/ivmech/ivPID</a></p>