0

I'm new to python. I'm writing a script that calls a command line tool and displays the output from the command on the screen. The issue is that after the command runs it doesn't exit on it's own, it requires manual typing of ctrl-c to stop and continue on with the rest of the python script. Does anyone know how I could get it to stop on it's own and continue on with the rest of the script?

cmd ='./ppshelper -sms "15062929382" warning'
os.system(cmd)
print "SMS sent"

"SMS sent" is not printed until the user presses ctrl-c

Thanks

1
  • 3
    The question is about ppshelper rather than Pyhton. Read its manual or ask its vendors. Commented Apr 29, 2012 at 12:23

1 Answer 1

1

Use Popen

from subprocess import Popen
p = Popen(['/full/path/to/ppshelper', '-sms', '15062929382','warning'])
p.terminate()
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this worked great! Any idea how I can get the output from p to display before the rest of the code is executed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.