Jun-28-2024, 04:45 PM
(This post was last modified: Jun-28-2024, 04:45 PM by deanhystad.)
Have you read through the subprocess.run documentation? A lot of your questions are answered here:
https://docs.python.org/3/library/subprocess.html
You need to check if there was an error. You are using check, but I would just look at the return code. If there was an error, return some markup that contains the error info that can be displayed on the web page.
https://docs.python.org/3/library/subprocess.html
You need to check if there was an error. You are using check, but I would just look at the return code. If there was an error, return some markup that contains the error info that can be displayed on the web page.
result = subprocess.run(..., check=False) if result.returncode != 0: return some_markup_containing_result.stderr elif result.stdout: return some_markup_containing_result.stdout else: return something else?