Anki/qt/launcher/src/libpython_nix.py
llama a64aad5e48
refactor get_libpython_path into get_python_env_info
instead of just libpython's path we now get and cache the nodot version and venv bin path
2025-11-02 17:53:09 +08:00

13 lines
423 B
Python

# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import json
import os
import sys
import sysconfig
cfg = sysconfig.get_config_var
base = cfg("installed_base") or cfg("installed_platbase")
lib = cfg("LDLIBRARY") or cfg("INSTSONAME")
version = cfg("py_version_nodot")
print(json.dumps([version, os.path.join(base, "lib", lib), sys.executable]))