【发布时间】:2020-06-06 03:23:14
【问题描述】:
我正在尝试使用
获取当前工作目录的文件和目录info = subprocess.run("dir", shell=True, capture_output=True)
print(info.stdout)
但我有带有é 的文件,它们被打印为,...
我也有空闲字节的问题,我明白了:
49ÿ372ÿ921ÿ856 octets libres
我尝试对其进行解码,但收到错误消息AttributeError: 'std_output' object has no attribute 'decode'
显然它已经被解码了。
【问题讨论】:
-
这是什么版本的 Python?想必您在这里使用的是 Windows?
-
在带有 python 3.8.3 的 Windows 上是的
标签: python python-3.x subprocess