Top-rated recipes tagged "process_management"http://code.activestate.com/recipes/tags/process_management/top/2015-12-27T20:45:32-08:00ActiveState Code Recipessubprocess.terminate() not always implemented (Python) 2009-02-25T10:45:01-08:00Gui Rhttp://code.activestate.com/recipes/users/4166241/http://code.activestate.com/recipes/576667-subprocessterminate-not-always-implemented/ <p style="color: grey"> Python recipe 576667 by <a href="/recipes/users/4166241/">Gui R</a> (<a href="/recipes/tags/process_management/">process_management</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/terminate/">terminate</a>). Revision 2. </p> <p>The new subprocess module brings clarity and simplicity over the popenXX() functions and os.spawnXX() functions, but some implementations don't have the subprocess.terminate() method, which is crucial for killing a spawned process. This workaround works on both POSIX and Windows.</p> Publish a Windows Process List to PDF with xtopdf (Batch) 2015-12-27T20:45:32-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/579142-publish-a-windows-process-list-to-pdf-with-xtopdf/ <p style="color: grey"> Batch recipe 579142 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/pdfwriter/">pdfwriter</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/processes/">processes</a>, <a href="/recipes/tags/process_management/">process_management</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>This recipe shows how you can generate a Windows process list or task list (basically, a list of running processes, with some information about each of them), to a PDF file, using the Windows TASKLIST command along with the xtopdf toolkit. The list is sorted in ascending order of memory usage of the processes, before writing it to PDF.</p> <p>It differs somewhat from other xtopdf recipes, in that no additional code needs to be written, over and above what is already in the xtopdf package. We just have to use the needed commands there, in a series of commands or a pipeline.</p> <p>However, one can still write additional code, by modifying the program used (StdinToPDF.py), if needed, to customize the PDF output.</p> Get parent process pid win32 (Python) 2012-05-15T18:01:22-07:00nuumiohttp://code.activestate.com/recipes/users/4182080/http://code.activestate.com/recipes/578133-get-parent-process-pid-win32/ <p style="color: grey"> Python recipe 578133 by <a href="/recipes/users/4182080/">nuumio</a> (<a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/process_management/">process_management</a>). </p> <p>Use ctypes + Win32 functions to enumerate processes and find parent process id.</p> <p>Thanks to winterTTr Dong for the original recipe.</p>