相关疑难解决方法(0)

subprocess.Popen使用unicode路径

我有一个我想打开的unicode文件名.以下代码:

cmd = u'cmd /c "C:\\Pok\xe9mon.mp3"'
cmd = cmd.encode('utf-8')
subprocess.Popen(cmd)
Run Code Online (Sandbox Code Playgroud)

回报

>>> 'C:\Pok?mon.mp3' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud)

即使该文件确实存在.为什么会这样?

python windows unicode command-line subprocess

7
推荐指数
1
解决办法
9140
查看次数

标签 统计

command-line ×1

python ×1

subprocess ×1

unicode ×1

windows ×1