import subprocess
def cmd(command):
subp = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8")
return subp.communicate()
res = cmd("ls -l")
res = res[0]
res = res.split("/n")
for line in res:
print(line)
搜索
复制
原创文章,作者:Carrie001128,如若转载,请注明出处:https://blog.ytso.com/270596.html