我在kali linux的python 2.7中编程我想运行这个命令" airdump-ng"在我的脚本,但命令运行,直到ctrl + c被按下这在终端很好,但在python当我点击ctrl + c它退出整个脚本不只是一个命令请帮我这个我似乎不能弄明白。
答案 0 :(得分:0)
你可以这样做:
try:
while True:
print "running..."
except KeyboardInterrupt:
print 'Ctrl-C was pressed'
print 'one more line'
运行此按钮并按Ctrl-C时,您将获得:
running...
running...
running...
running...
Ctrl-C was pressed
one more line