Cameron Laird wrote:
...
> Particularly when I hear "os-independent", I think first of
> binding to a socket. While http://wiki.tcl.tk/1558 >
> is written for a Tcl-based crowd, the commentary there ap-
> plies quite well to Python.
I was going to suggest something like this, as I have noticed th
In article <[EMAIL PROTECTED]>,
Simon Forman <[EMAIL PROTECTED]> wrote:
>gmax2006 wrote:
.
.
.
>> > Yes, there are several ways. What OS are you using?
>> >
>> > ~Simon
>>
>> I have to use an os-independent approach.
>>
>> At
gmax2006 wrote:
> Simon Forman wrote:
> > gmax2006 wrote:
> > > Hi,
> > >
> > > Is it possible that a python script finds out whether another instance
> > > of it is currently running or not?
> > >
> > > Thank you,
> > > Max
> >
> > Yes, there are several ways. What OS are you using?
> >
> > ~Simo
Simon Forman wrote:
> gmax2006 wrote:
> > Hi,
> >
> > Is it possible that a python script finds out whether another instance
> > of it is currently running or not?
> >
> > Thank you,
> > Max
>
> Yes, there are several ways. What OS are you using?
>
> ~Simon
I have to use an os-independent approa
IPC via files, sockets, and shared memory are all readily available in
python.
the simplest way is to have the script write its pid to a certain file.
pidfn = '/tmp/hellowerld_ipc_pid'
if os.path.isfile(pidfn):
f = file(pidfn)
pid = f.read()
f.close()
if pid in os.popen('ps -A -o p
gmax2006 wrote:
> Hi,
>
> Is it possible that a python script finds out whether another instance
> of it is currently running or not?
>
> Thank you,
> Max
Yes, there are several ways. What OS are you using?
~Simon
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is it possible that a python script finds out whether another instance
of it is currently running or not?
Thank you,
Max
--
http://mail.python.org/mailman/listinfo/python-list