On 27 fév, 11:28, Thinker <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] [EMAIL > PROTECTED]://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 > > iD8DBQFF5Afi1LDUVnWfY8gRAgaoAJ9fccAjo00QupE7SRFqgbmOUGZMugCgjvdH > 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() -- http://mail.python.org/mailman/listinfo/python-list