process and spinning slash
Fredrik Lundh
fredrik at pythonware.com
Mon Oct 31 09:33:49 EST 2005
"benz" <benzwt at yahoo.com.tw> wrote
>I have rewrited my code as follow, but it still not working.
>
> import os, sys
>
>
> pid = os.fork()
>
> if pid == 0:
> os.execvp("du",("du","-shc","/usr/share"))
> else:
> while 1:
> try:
> os.kill(pid,0)
> sys.stdout.write('running')
> sys.stdout.flush()
> sys.stdout.write('\b\b\b\b\b\b\b')
> except OSError:
> print "child ended"
thomas has already explained why that doesn't work:
http://article.gmane.org/gmane.comp.python.general/428821
</F>
More information about the Python-list
mailing list