So I\'m trying to move away from os.popen to subprocess.popen as recommended by the user guide. The only trouble I\'m having is I can\'t seem to find a way of making readli
With subprocess.Popen, use communicate to read and write data:
subprocess.Popen
communicate
out, err = subprocess.Popen(['ls','-l'], stdout=subprocess.PIPE).communicate()
Then you can always split the string from the processes' stdout with splitlines().
stdout
splitlines()
out = out.splitlines()