wim*_*wim 11 python posix signals python-3.x
在REPL中,我们通常可以使用sigint(即ctrl+)中断无限循环c,并在解释器中重新获得控制权.
>>> while True: pass
...
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>>
Run Code Online (Sandbox Code Playgroud)
但是在这个循环中,中断似乎被阻止了,我必须杀死父进程才能逃脱.
>>> *x, = itertools.repeat('x')
^C^C^C^C^C^C^C^C^\^\^\^\^\^Z^Z^Z^Z
Run Code Online (Sandbox Code Playgroud)
这是为什么?
| 归档时间: |
|
| 查看次数: |
277 次 |
| 最近记录: |