How do I run the following cmd command with subprocess.check_output?
cd C:/Users/Administrator/Desktop/files
dir /b | find /i "copy"
In [1]: import os
In [2]: import subprocess
In [3]: os.chdir("D:\workspacke\python\py35_x86")
In [4]: output = subprocess.check_output('dir/b | find/i "copy", shell=True)
In [5]: print(output)
b'\xbb\xe7\xba\xbb aaa.txt\r\n'
In [6]: print(output.decode('euc-kr'))
Copy aaa.txt
© 2024 OneMinuteCode. All rights reserved.