import subprocess import shutil import os # Пути dist_path = os.path.abspath("./") # текущая папка — exe будет тут work_path = os.path.abspath("./build_temp") spec_path = os.path.abspath("./build_temp") script_dir = os.path.dirname(os.path.abspath(__file__)) libclang_path = os.path.join(script_dir, "libclang.dll") # Запуск PyInstaller с нужными параметрами cmd = [ "pyinstaller", "--onefile", "--windowed", "--name", "DebugVarEdit", "--add-binary", f"{libclang_path};.", "--distpath", dist_path, "--workpath", work_path, "--specpath", spec_path, "./Src/setupVars_GUI.py" ] result = subprocess.run(cmd) if result.returncode == 0: # Удаляем временные папки for folder in ["build_temp", "__pycache__"]: if os.path.exists(folder): shutil.rmtree(folder) print("Сборка успешно завершена!") else: print("Сборка завершилась с ошибкой.")