exception KeyboardInterrupt and os.system command

malv malvert at telenet.be
Tue Nov 29 03:26:44 EST 2005


Indeed, I did the experiment again with
while 1:
   y = os.system("sleep 1")
   print y
and it ALWAYS returns 0, with control-c or without.

>From past experience, I am pretty sure that in other cases I have been
getting non-zero return values. So I would hesitate to believe that
what you observe is due to something within your application package.
Maybe as Don Cave suggests, one should try spawnv although it seems to
be more complicated to use it with "sleep 1".




More information about the Python-list mailing list