dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import subprocess
|
|
|
|
|
|
def run_cmd(cmd: list[str]) -> str:
|
|
return subprocess.check_output(cmd, encoding='utf8').strip()
|
|
|
|
|
|
def run_cmd_default(cmd: list[str], default: str = "") -> str:
|
|
try:
|
|
return run_cmd(cmd)
|
|
except subprocess.CalledProcessError:
|
|
return default
|
|
|
|
|