how to run my own external command in python script
Question: I wanna to run my own non-system external commands in python.

Such as "sudo insteon on 23". Subprocess and os.system are designed for system
calls.

Does anybody know how to do it?

Thanks


Answer: You can use
[subprocess.Popen](http://docs.python.org/2/library/subprocess.html#using-the-
subprocess-module) for this:

    
    
    import shlex
    import subprocess
    proc = subprocess.Popen(shlex.split('sudo insteon on 23'))
    proc.communicate()
    

