Python subprocess.popen returns empty string
Question: 
    import subprocess
    cd=['sudo','./interface','-a','</tmp/vol.js']
    p = subprocess.Popen(cd, stdout = subprocess.PIPE,stderr=subprocess.PIPE, stdin=subprocess.PIPE)
    

Above code returns null but when I run same same command i.e `sudo ./interface
-a </tmp/vol.js` works totally fine


Answer: You are using _shell-specific redirection syntax_ (`</tmp/vol.js`) but
`subprocess.Popen()` doesn't run your command in a shell.

You'd need to either run the command in a shell (pass in a _string_ , not a
list, and set `shell=True`), or open `vol.js` yourself and write that to the
process through the `stdin` pipe you opened:

    
    
    import subprocess
    command = ('sudo', './interface', '-a')
    with open('/tmp/vol.js') as input_stream
        p = subprocess.Popen(cd, stdout=subprocess.PIPE, 
                             stderr=subprocess.PIPE, stdin=input_stream)
        stdout, stderr = p.communicate()
    

Note that I passed in the open `vol.js` file object as the input stream here.

