Python run command till button is pressed -


im programing in python 2.7 in kali linux wanna run command "airdump-ng" in script command runs ever until ctrl+c pressed fine in terminal in python when hit ctrl+c exits out of whole script not 1 command please me cant seem figure out.

you can this:

try:   while true:      print "running..." except keyboardinterrupt:   print 'ctrl-c pressed'  print 'one more line' 

when run , press ctrl-c, you'll get:

running... running... running... running... ctrl-c pressed 1 more line 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -