473,396 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

spawnl and waitpid

hello,

I run a python cgi script under Apache...

and while the script is running i want to display a "please wait"
message until the script finish.

I have tried to do this but the "please wait" message appears at the
script end (which is useless at this time! )

here my script:
------------------------------------------------------------------------------------------------
def get_ret(status):
signal = status & 0xff
if signal == 0:
retcode = status >8
else:
retcode = 0
return signal,retcode

pidActuel = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")

if ( get_ret(os.waitpid(pidActuel,0))[1] == 0 ):
print """ END"""
else:
print """ please wait... """

-------------------------------------------------------------------------------------------------

Feb 27 '07 #1
12 2861

i forgot ...
thanks for any help :)

Feb 27 '07 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

na********@gmail.com wrote:
hello,

I run a python cgi script under Apache...

and while the script is running i want to display a "please wait"
message until the script finish.

I have tried to do this but the "please wait" message appears at
the script end (which is useless at this time! )
You should flush sys.stdout after you print messages, or
the message will keep in buffer untill buffer is full or process
terminated.
- --
Thinker Li - th*****@branda.to th********@gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5Afi1LDUVnWfY8gRAgaoAJ9fccAjo00QupE7SRFqgb mOUGZMugCgjvdH
cFoxm+jiZiIpKOfd+fHCt/M=
=9COv
-----END PGP SIGNATURE-----

Feb 27 '07 #3
On 27 fév, 11:28, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

naima.m...@gmail.com wrote:
hello,
I run a python cgi script under Apache...
and while the script is running i want to display a "please wait"
message until the script finish.
I have tried to do this but the "please wait" message appears at
the script end (which is useless at this time! )

You should flush sys.stdout after you print messages, or
the message will keep in buffer untill buffer is full or process
terminated.

- --
Thinker Li - thin...@branda.to thinker...@gmail.comhttp://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

iD8DBQFF5Afi1LDUVnWfY8gRAgaoAJ9fccAjo00QupE7SRFqgb mOUGZMugCgjvdH
cFoxm+jiZiIpKOfd+fHCt/M=
=9COv
-----END PGP SIGNATURE-----
Hello

thanks for answering
i have flush like this but same result .. the server wait until the
end...

pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
sys.stdout.flush()
ret = os.waitpid(pid,0)

if ( ret[1] != 0):
print """ wait %i """ %ret[1]
sys.stdout.flush()
else:
print """ end %i """ %ret[1]
sys.stdout.flush()
Feb 27 '07 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

na********@gmail.com wrote:
On 27 fév, 11:28, Thinker <thin...@branda.towrote:
naima.m...@gmail.com wrote:
>>>hello, I run a python cgi script under Apache... and while
the script is running i want to display a "please wait"
message until the script finish. I have tried to do this but
the "please wait" message appears at the script end (which is
useless at this time! )
You should flush sys.stdout after you print messages, or the
message will keep in buffer untill buffer is full or process
terminated.
Hello
thanks for answering i have flush like this but same result .. the
server wait until the end...
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py") sys.stdout.flush() ret =
os.waitpid(pid,0)
Your program will be blocked here until child process being terminated.
You should print your messages before this line.
if ( ret[1] != 0): print """ wait %i """ %ret[1]
sys.stdout.flush() else: print """ end %i """ %ret[1]
sys.stdout.flush()

- --
Thinker Li - th*****@branda.to th********@gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5BWS1LDUVnWfY8gRAkp8AKCAcTKi/MO6sfkGBBEcMjfpH42O1wCeN14I
0AZ83oVacK0hKik4YC/jfCA=
=3h7d
-----END PGP SIGNATURE-----

Feb 27 '07 #5
On 27 fév, 12:27, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

naima.m...@gmail.com wrote:
On 27 fæ†, 11:28, Thinker <thin...@branda.towrote:
naima.m...@gmail.com wrote:
>>hello, I run a python cgi script under Apache... and while
the script is running i want to display a "please wait"
message until the script finish. I have tried to do this but
the "please wait" message appears at the script end (which is
useless at this time! )
You should flush sys.stdout after you print messages, or the
message will keep in buffer untill buffer is full or process
terminated.
Hello
thanks for answering i have flush like this but same result .. the
server wait until the end...
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py") sys.stdout.flush() ret =
os.waitpid(pid,0)

Your program will be blocked here until child process being terminated.
You should print your messages before this line.
if ( ret[1] != 0): print """ wait %i """ %ret[1]
sys.stdout.flush() else: print """ end %i """ %ret[1]
sys.stdout.flush()

- --
Thinker Li - thin...@branda.to thinker...@gmail.comhttp://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

iD8DBQFF5BWS1LDUVnWfY8gRAkp8AKCAcTKi/MO6sfkGBBEcMjfpH42O1wCeN14I
0AZ83oVacK0hKik4YC/jfCA=
=3h7d
-----END PGP SIGNATURE------ Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
thanks again

i have tried as you said (cf bellow) and same result...
is there any link which explain how a server Web read script and send
the answer ?

-------------------------------------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
ret = os.waitpid(pid,0)
print """please wait ...."""
sys.stdout.flush()
# retourne le process id
if ( ret[1] != 0):
print """ wait %i """ %ret[1]
sys.stdout.flush()
else:
print """ end %i """ %ret[1]
sys.stdout.flush()
---------------------------------------------------------------------------
thanks

Feb 27 '07 #6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

na********@gmail.com wrote:
i have tried as you said (cf bellow) and same result... is there
any link which explain how a server Web read script and send the
answer ?
-------------------------------------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
print 'please wait...'
ret = os.waitpid(pid,0)
You have missed my idea.
Since os.waitpid will be blocked, you should print your message before
calling os.waitpid().
- --
Thinker Li - th*****@branda.to th********@gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5HA61LDUVnWfY8gRAu8sAJ4n1dogsw7RzTxH8Ke3xn NX6gXnRQCeMOKf
/dsGHttcJc/KGpx414I7rxw=
=E3o7
-----END PGP SIGNATURE-----

Feb 27 '07 #7
On 27 fév, 18:54, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

naima.m...@gmail.com wrote:
i have tried as you said (cf bellow) and same result... is there
any link which explain how a server Web read script and send the
answer ?
-------------------------------------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")

print 'please wait...'
ret = os.waitpid(pid,0)

You have missed my idea.
Since os.waitpid will be blocked, you should print your message before
calling os.waitpid().

- --
Thinker Li - thin...@branda.to thinker...@gmail.comhttp://heaven.branda.to/~thinker/GinGin_CGI.py

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

iD8DBQFF5HA61LDUVnWfY8gRAu8sAJ4n1dogsw7RzTxH8Ke3xn NX6gXnRQCeMOKf
/dsGHttcJc/KGpx414I7rxw=
=E3o7
-----END PGP SIGNATURE-----
hello

ha ok...

i tried this one and the browser don't write the message at once... I
have alos tried with thread and have the same result... :(

----------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
print 'please wait...'
sys.stdout.flush()
ret = os.waitpid(pid,0)
# retourne le process id
if ( ret[1] != 0):
print """ wait %i """ %ret[1]
sys.stdout.flush()
else:
print """ end %i """ %ret[1]
sys.stdout.flush()
-----------------------------

--------- WITH THREAD ----------------

class AsyncLaunch(threading.Thread):
def __init__(self, infile):
threading.Thread.__init__(self)
self.infile = infile
def run(self):
os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python",self.infile)
print 'Fin background'

print """please wait..."""
sys.stdout.flush()
sys.stdout.close()
###### # print "<a href=\\\\Fr9033256d\execute\%s>fichier de log </
a>" %config.nom_log
background = AsyncLaunch('Main.py')
background.start()
######
print """The main program continues to run in foreground. wait..."""
print """ <a href='http://fr9033256d/cgi-bin/SARAT/go.py'>clic</a>"""
background.join() # Wait for background task to finish
print """Main program waited until background was done."""
-------------------
-----------------------

Feb 27 '07 #8
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

na********@gmail.com wrote:
On 27 fév, 18:54, Thinker <thin...@branda.towrote:
hello
ha ok...
i tried this one and the browser don't write the message at once...
I have alos tried with thread and have the same result... :(
Does child-process terminate it-self in a very short time ?
It can be a race condition, here.
You can try to sleep for a while in child-process to make sure parent
being executed. Parent process may not schedule to run immediately
after spawn. And, you can print some thing before os.spawnl() to make
sure that message can be delivered successfully.
- --
Thinker Li - th*****@branda.to th********@gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5Hkp1LDUVnWfY8gRAtDdAKCKy8/ap5VJvZV14nhSCWYfLZdyYACffJ+Y
0sHMgyaQBmsOMwq/rxEvm1Q=
=qjTU
-----END PGP SIGNATURE-----

Feb 27 '07 #9
On 27 fév, 19:31, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On 27 Feb 2007 05:39:51 -0800, naima.m...@gmail.com declaimed the
following in comp.lang.python:
On 27 fév, 12:27, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
<snip>
Your program will be blocked here until child process being terminated.
You should print your messages before this line.
i have tried as you said (cf bellow) and same result...

No, you did NOT do as was suggested (unless you misunderstood which
line "before this" meant.
is there any link which explain how a server Web read script and send
the answer ?
-------------------------------------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
ret = os.waitpid(pid,0)

As soon as you execute os.waitpid(), your script WAITS. NOTHING
after that point will happen until the process you are waiting on exits.
print """please wait ...."""
sys.stdout.flush()
# retourne le process id
if ( ret[1] != 0):
print """ wait %i """ %ret[1]
sys.stdout.flush()
else:
print """ end %i """ %ret[1]
sys.stdout.flush()

pid = os.spawnl(os.P_NOWAIT,
"c:\\python25\\python.exe",
"python",
"Main.py") #apparently a Windows OS
print "Please wait ..."
sys.stdout.flush()
ret = os.waitpid(pid, 0)

if ret[1]:
print "Non-zero exit code: %s %s" % (ret[1], ret[0])
else:
print "Successful exit"
sys.stdout.flush()

{I'm presuming a 0 return code means success... VMS used 1 for success
and 0 for failure [actually, odd numbers were informational status, even
numbers were error status]}
---------------------------------------------------------------------------
thanks

--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@ix.netcom.com wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-a...@bestiaria.com)
HTTP://www.bestiaria.com/
hello

thanks a lot..

sorry for misunderstanding, my english isn't good (i'm french).

i have tried like this:
----------------------------------------------
#! C:/Python25/python.exe
# -*- coding: cp1252 -*-
import cgitb; cgitb.enable()
import os,sys

print "Content-Type: text/html"
print

pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
print "please wait.."
sys.stdout.flush()
ret = os.waitpid(pid,0)
# retourne le process id
if ret[1]:
print "Non-zero exit code: %s %s" % (ret[1], ret[0])
else:
print "Successful exit"
sys.stdout.flush()
--------------------------------------------------------

and the result:

At the end of the script execution it write:
==>>> please wait.. Successful exit

The browser doesn't let the script executing on background to write
the message at once.. it waits the end.
what happend?

Feb 28 '07 #10
On 28 fév, 10:13, naima.m...@gmail.com wrote:
On 27 fév, 19:31, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:


On 27 Feb 2007 05:39:51 -0800, naima.m...@gmail.com declaimed the
following in comp.lang.python:
On 27 fév, 12:27, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
<snip>
Your program will be blocked here until child process being terminated.
You should print your messages before this line.
i have tried as you said (cf bellow) and same result...
No, you did NOT do as was suggested (unless you misunderstood which
line "before this" meant.
is there any link which explain how a server Web read script and send
the answer ?
-------------------------------------------------------------------------
pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
ret = os.waitpid(pid,0)
As soon as you execute os.waitpid(), your script WAITS. NOTHING
after that point will happen until the process you are waiting on exits.
print """please wait ...."""
sys.stdout.flush()
# retourne le process id
if ( ret[1] != 0):
print """ wait %i """ %ret[1]
sys.stdout.flush()
else:
print """ end %i """ %ret[1]
sys.stdout.flush()
pid = os.spawnl(os.P_NOWAIT,
"c:\\python25\\python.exe",
"python",
"Main.py") #apparently a Windows OS
print "Please wait ..."
sys.stdout.flush()
ret = os.waitpid(pid, 0)
if ret[1]:
print "Non-zero exit code: %s %s" % (ret[1], ret[0])
else:
print "Successful exit"
sys.stdout.flush()
{I'm presuming a 0 return code means success... VMS used 1 for success
and 0 for failure [actually, odd numbers were informational status, even
numbers were error status]}
---------------------------------------------------------------------------
thanks
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@ix.netcom.com wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-a...@bestiaria.com)
HTTP://www.bestiaria.com/

hello

thanks a lot..

sorry for misunderstanding, my english isn't good (i'm french).

i have tried like this:
----------------------------------------------
#! C:/Python25/python.exe
# -*- coding: cp1252 -*-

import cgitb; cgitb.enable()
import os,sys

print "Content-Type: text/html"
print

pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
print "please wait.."
sys.stdout.flush()
ret = os.waitpid(pid,0)
# retourne le process id
if ret[1]:
print "Non-zero exit code: %s %s" % (ret[1], ret[0])
else:
print "Successful exit"
sys.stdout.flush()
--------------------------------------------------------

and the result:

At the end of the script execution it write:
==>>> please wait.. Successful exit

The browser doesn't let the script executing on background to write
the message at once.. it waits the end.

what happend?- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
re hello

perhaps there is a link with the script being called..
as there is a function which use stdout:
here it is
--------------------------------------------
def erreur_ccm(cmd):
try:
child_stdin, child_stdout, child_stderr =os.popen3(cmd)
stderr=child_stderr.read()
stdout=child_stdout.read()
if stderr == "":
retour = stdout
else :
retour = 0
except OSError, e:
child_stdin.close()
child_stdout.close()
child_stderr.close()

return retour
----------------------------------------------

Feb 28 '07 #11
On 27 fév, 19:32, Thinker <thin...@branda.towrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

naima.m...@gmail.com wrote:
On 27 fæ†, 18:54, Thinker <thin...@branda.towrote:
hello
ha ok...
i tried this one and the browser don't write the message at once...
I have alos tried with thread and have the same result... :(

Does child-process terminate it-self in a very short time ?
It can be a race condition, here.
You can try to sleep for a while in child-process to make sure parent
being executed. Parent process may not schedule to run immediately
after spawn. And, you can print some thing before os.spawnl() to make
sure that message can be delivered successfully.

- --
Thinker Li - thin...@branda.to thinker...@gmail.comhttp://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

iD8DBQFF5Hkp1LDUVnWfY8gRAtDdAKCKy8/ap5VJvZV14nhSCWYfLZdyYACffJ+Y
0sHMgyaQBmsOMwq/rxEvm1Q=
=qjTU
-----END PGP SIGNATURE-----
hello

oki, i have test a simple script that only wait...
when i tun the script without the server it write on 2 time which is
normal:
================================================
Content-Type: text/html
wait
The main program continues to run in foreground.
[[[[(((then after 5 second ))]]]]]]]
Fin background
Main program waited until background was done.
==================================================

BUT when i call it under the server web it write after 5 second all
the message in 1 time :
================================================== =
wait The main program continues to run in foreground. Fin background
Main program waited until background was done.
================================================== =

-----------------------THE SCRIPT ---------------------------
import cgitb; cgitb.enable()
import os,sys
import threading, zipfile,time,Main

print "Content-Type: text/html"
print
print "wait"
sys.stdout.flush()

class AsyncZip(threading.Thread):
def __init__(self, infile):
threading.Thread.__init__(self)
self.infile = infile
def run(self):
time.sleep(5.0)
print 'Fin background'

background = AsyncZip('Main.py')
background.start()
print 'The main program continues to run in foreground.'
sys.stdout.flush()
background.join() # Wait for background task to finish
print 'Main program waited until background was done.'
sys.stdout.flush()
---------------------------------------------------------------

Feb 28 '07 #12
On 28 fév, 11:23, naima.m...@gmail.com wrote:
On 27 fév, 19:32, Thinker <thin...@branda.towrote:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
naima.m...@gmail.com wrote:
On 27 fæ†, 18:54, Thinker <thin...@branda.towrote:
hello
ha ok...
i tried this one and the browser don't write the message at once...
I have alos tried with thread and have the same result... :(
Does child-process terminate it-self in a very short time ?
It can be a race condition, here.
You can try to sleep for a while in child-process to make sure parent
being executed. Parent process may not schedule to run immediately
after spawn. And, you can print some thing before os.spawnl() to make
sure that message can be delivered successfully.
- --
Thinker Li - thin...@branda.to thinker...@gmail.comhttp://heaven.branda..to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
iD8DBQFF5Hkp1LDUVnWfY8gRAtDdAKCKy8/ap5VJvZV14nhSCWYfLZdyYACffJ+Y
0sHMgyaQBmsOMwq/rxEvm1Q=
=qjTU
-----END PGP SIGNATURE-----

hello

oki, i have test a simple script that only wait...
when i tun the script without the server it write on 2 time which is
normal:
================================================
Content-Type: text/html
wait
The main program continues to run in foreground.
[[[[(((then after 5 second ))]]]]]]]
Fin background
Main program waited until background was done.
==================================================

BUT when i call it under the server web it write after 5 second all
the message in 1 time :
================================================== =
wait The main program continues to run in foreground. Fin background
Main program waited until background was done.
================================================== =

-----------------------THE SCRIPT ---------------------------
import cgitb; cgitb.enable()
import os,sys
import threading, zipfile,time,Main

print "Content-Type: text/html"
print
print "wait"
sys.stdout.flush()

class AsyncZip(threading.Thread):
Â* Â* def __init__(self, infile):
Â* Â* Â* Â* threading.Thread.__init__(self)
Â* Â* Â* Â* self.infile = infile
Â* Â* def run(self):
Â* Â* Â* Â* time.sleep(5.0)
Â* Â* Â* Â* print 'Fin background'

background = AsyncZip('Main.py')
background.start()
print 'The main program continues to run in foreground.'
sys.stdout.flush()
background.join() Â* Â*# Wait for background task to finish
print 'Main program waited until background was done.'
sys.stdout.flush()
---------------------------------------------------------------- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
hello

The pb seems to be solve but no idee why as i have done lot of
changes :/ (may be the last flush or the "\n".. i'm gone
investigate..)

THANKSSSSSSSSSSSSSSSSS for helping :)

for information here the code

----------------------------------------------------------

#! C:/Python25/python.exe -u
# -*- coding: cp1252 -*-
import cgitb; cgitb.enable()
import os, commands, time,Parser,config
import cgi

import sys,Function
sys.stderr = sys.stdout
print "Content-Type: text/html"
print

pid = os.spawnl(os.P_NOWAIT,"c:\\python25\
\python.exe","python","Main.py")
print "please wait...\n"
print """Le fichier de log est consultable sur \\\\fr9033256d
\execute\%s \n""" %config.nom_log
sys.stdout.flush()
ret = os.waitpid(pid,0)
if ret[1]:
print "Non-zero exit code: %s %s" % (ret[1], ret[0])
else:
print "Successful exit"
sys.stdout.flush()

Feb 28 '07 #13

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

Similar topics

1
by: SM Ryan | last post by:
On Unix (MacOSX 10.3), I have an exec $rs = array(); $rc = 0; exec("program yadda yadda yadda",$rs,$rc); and the program does a fork with parent exitting immediately (to daemonise the...
0
by: nushin | last post by:
Greetings, I am running RedHat 7.3 and trying to spawn a hello.py program from hello_driver.py by using spawn*( ) API, as a P_NOWAIT : os.spawnv(os.P_NOWAIT,'/usr/bin/python',('python hello.py...
3
by: nushin | last post by:
Try to launch a test program that prints hello world for a minute or so using, spawnv( ) or spawnl( ). Check to see the process state code that the program is running. I am using RedHat Linux 7.3...
0
by: Steve Homer | last post by:
Hi everyone, Appologies if this is the wrong forum for this post. I am a little confused by the code below and any help would be much appreciated. import os,signal,time,sys class Tzap:
0
by: Jonathan Ellis | last post by:
When I start a (py2exe'd python) program from another with spawnl on windows, the program name is omitted from its argv. Is there another way to introspect this big of information? It's ugly...
4
by: lasek | last post by:
Hi all, i have made a simple script that use fork, waitpid and sigaction for SIGCHLD. #include<sys/types.h> #include<sys/wait.h> #include<stdio.h> #include<errno.h> #include<unistd.h>...
6
by: Salvatore | last post by:
Hello, Does someone already had ths problem ? >>> os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe') Traceback (most recent call last): File "<stdin>", line 1, in ? File...
0
by: Nico Kruger | last post by:
I want to execute a command (in this case, and it seems to be significant, a Java program) in a thread in Python. When I execute the java binary in the main python thread, everything runs...
3
by: Tor Erik | last post by:
Hi, I need to start a program in a new cmd-window. To do this I need to execute: start With os.system this is straight-forward. But I need to do it with spawnl and P_NOWAIT. I.e,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.