killing a script
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Fri Sep 9 08:16:00 EDT 2011
Hans Mulder wrote:
> On 9/09/11 11:07:24, Steven D'Aprano wrote:
>> Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation of
>> script.py. While script.py is running, it receives the Ctrl-C, the
>> calling process does not.
>
> You misinterpret what you are seeing: the calling process *does* receive
> the ctrl-C, it just chooses to ignore it.
>
> This is documented behaviour of os.system.
Documented where? Neither the on-line documentation nor the function
docstring mentions anything about it that I can see:
http://docs.python.org/py3k/library/os.html#os.system
>>> help(os.system)
Help on built-in function system in module posix:
system(...)
system(command) -> exit_status
Execute the command (a string) in a subshell.
--
Steven
More information about the Python-list
mailing list