Subprocess module fails to run command

前端 未结 3 528
说谎
说谎 2021-01-13 23:25

I\'m trying to execute Google\'s cpplint.py on a group of my files and collect the results to one log file. However, I have not managed to beat the subprocess module. My cur

3条回答
  •  清酒与你
    2021-01-14 00:19

    I would request you to run this first

    pipe = subprocess.Popen([cmd, options],stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    stdout, stderr = pipe.communicate()
    

    You will get to know what exactly is the error behind it, since CalledProcessError is raised only if the exit code was non-zero.

提交回复
热议问题