472,958 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Get the status of a process

Hi,

I'm pretty brain dead reading the python docs about the processes.

I'm looking for some pythonig way to do a...

$ ps x | grep <some_pid>

.... in order to know if <some_pid> is running or not.

Thanks in advance for any hint.

--
Gilles

Jul 18 '05 #1
2 2511
Gilles Lenfant <no*************@bigfoot.com> writes:
Hi,

I'm pretty brain dead reading the python docs about the processes.

I'm looking for some pythonig way to do a...

$ ps x | grep <some_pid>

... in order to know if <some_pid> is running or not.

Thanks in advance for any hint.


os.kill(some_pid, 0)?

You might get EPERM if the process is running, but as a different
user.

Cheers,
mwh

--
Gullible editorial staff continues to post links to any and all
articles that vaguely criticize Linux in any way.
-- Reason #4 for quitting slashdot today, from
http://www.cs.washington.edu/homes/k.../slashdot.html
Jul 18 '05 #2
Michael Hudson wrote:

os.kill(some_pid, 0)?

You might get EPERM if the process is running, but as a different
user.

Cheers,
mwh


Many thanks. This does the job (raises an OSError when process is dead)

--
Gilles

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ishwar Rattan | last post by:
Here is a piece code (according to blurb on os.wait, the lower order 7 bits of exit status of process should contain the signal number of signal that terminated the process..) and signal number...
1
by: yyii | last post by:
Hi, I have a problem on retreiving the status of the child process. I want to open IE and load local file. Just after it is loaded, I need to delete that local file. It seems that I can't use...
8
by: mark4asp | last post by:
Why won't the window.status message change ? IE ver. 6.0.2800.1106 displays the tooltip OK. <td> <A HREF="editAuthor.asp?item=4" title="Edit author details"...
2
by: seash | last post by:
hi I wrote a class like this.......in my application. public class cls { public static extern bool myApp ( ref string aa,
3
by: bygandhi | last post by:
Hi - I am writing a service which will check a process and its threads for their state ( alive or dead ). The process has 5 .net managed threads created using thread.start and each have been...
1
by: Francis | last post by:
Hi everyone, I was just wondering if anyone could help me. I am writing a small win32 app using C#/.net. When something is executed, I want to put in a counter which counts up how long the process...
1
by: Velhari | last post by:
Hi all, I Need your help....... I developed the code for multiple file upload in PHP. In My Program there is 3 File Input type ==> Getting the File Name 3 iFrame tags ==>...
18
by: mistral | last post by:
Is there some other (more advanced) effects for status bar, other than standard Scroller Bar, TypeWriter Scroller, Flashing Bar, Decrypter, Ticker, World Clock?
4
by: frozenade | last post by:
Hello all.. merry christmas.. :) I need to show progress status when a button is clicked. I use this script. but I know that this code is still very bad. <html>
0
by: Edwin.Madari | last post by:
updated creature running in its own thread will get you started. try it foryourself, change sleep times per your need. import os, sys, threading, time class Creature: def __init__(self,...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.