Calling a subprocess in python gives the "Bad file descriptor" error

Whenever I call executable c code from Python using the method below, I get a "Bad file descriptor" error. When I run the code from the command line, it works fine. Help me please!?

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
+4
source share
1 answer

try it

import subprocess

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

Source: https://habr.com/ru/post/1629471/


All Articles