INNER CODE UNIT · Python

output_json

zhinkgit/embeddedskills · can/scripts/can_decode.py:14

def output_json(result):
    sys.stdout.buffer.write(json.dumps(result, ensure_ascii=False, indent=2).encode("utf-8"))
    sys.stdout.buffer.write(b"\n")
    sys.stdout.buffer.flush()


def load_database(db_path, db_format="auto"):
    """加载数据库文件"""
    import cantools

    path = Path(db_path)
    if not path.exists():
        return None, f"数据库文件不存在: {db_path}"

    try:
        if db_format == "auto":
            db = cantools.database.load_file(str(path))
        else:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…