小编sci*_*guy的帖子

python上的子进程调用给出错误"错误的文件描述符"

每当我使用下面的方法从Python调用ac代码可执行文件时,我得到一个"错误的文件描述符"错误.当我从命令提示符运行代码时它工作正常.请帮忙!?

import subprocess

p = subprocess.call(['C:\Working\Python\celp.exe', '-o', 'ofile'], stdin=subprocess.PIPE, stderr=subprocess.STDOUT)

In [84]: %run "C:\Working\Python\test.py"
Error: : Bad file descriptor
Run Code Online (Sandbox Code Playgroud)

python subprocess file-descriptor

6
推荐指数
2
解决办法
3496
查看次数

标签 统计

file-descriptor ×1

python ×1

subprocess ×1