So I am learning how to use cmd from python and tried to do this:
import subprocess
proc = subprocess.Popen('cmd.exe', stdin = subprocess.PIPE, encoding =
'utf8', stdout = subprocess.PIPE)
stdout, stderr = proc.communicate('dir c:\\')
print(stdout)
This apparently does not work as this is what i recieve:
Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\User\AppData\Local\Programs\Python\Python36-32>More?
WHy only one line and not what was commanded?