python静态代码编译工具nuitka

卓能文 / 2025-01-20 / 原文

nuitka

# test.py
def add(x: int, y: int) -> int:
    return x + y


print(add(2, 3))
nuitka test.py --onefile --clang --static-libpython=yes
# justfile
build:
    #!/bin/env bash
    # export LDFLAGS="-static"
    nuitka test.py --onefile --clang --static-libpython=yes