Answer the question
In order to leave comments, you need to log in
Executing a Compiled Program in a Python Script
There is a ready-made console program so that during the execution of the pyhton script, commands with keys are passed to it and its validity is monitored, is it possible to do this in python?
Answer the question
In order to leave comments, you need to log in
Here are the code snippets from my Python 3.3 script:
def _run_process(self, args):
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdoutBin = proc.stdout.read()
stderrBin = proc.stderr.read()
proc.stdout.close()
proc.stderr.close()
proc.wait()
self._toolResult['retcode'] = proc.returncode
self._toolResult['stdout'] = stdoutBin.decode('ascii')
self._toolResult['stderr'] = stderrBin.decode('ascii')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question