I might be missing the obvious, but I don't think the subprocess module has a method that will capture the standard output, standard error, and the exit code of a subprocess in a single call. It is ...
≮Python≯ 一時的に標準出力を NULL にリダイレクトするサンプルプログラム sout_null.py Pythonで一時的に標準出力を NULL にリダイレクトするサンプルプログラムです。 個人的なメモとして書いたプログラムですが、需要があるかもしれないと思い公開しました。
This is a simple example of using the OpenTelemetry Python SDK to create and export spans in OTLP JSON format to stdout. This is useful as a shim for systems that don't support traces first class, but ...