Python: How to get stdout after running os.system? [duplicate]
If all you need is the stdout output, then take a look at subprocess.check_output(): import subprocess batcmd=”dir” result = subprocess.check_output(batcmd, shell=True) Because you were using os.system(), you’d have to set shell=True to get the same behaviour. You do want to heed the security concerns about passing untrusted arguments to your shell. If you need to … Read more