当前位置: 首页 > news >正文

cx_Freeze python 打包详解

优点:有时比 PyInstaller 更好处理外部 .pyd

做法:

  1. 安装 cx_Freeze

    sh

    pip install cx_Freeze

  1. 新建 setup.py:

    python

        from cx_Freeze import setup, Executablebuild_exe_options = {"packages": ["apscheduler.triggers.interval", "apscheduler.triggers.cron", "apscheduler.triggers.date"],"include_files": [("C:/Program Files (x86)/Kongsberg/K-Spice/bin64/kspice.cp312-win_amd64.pyd", "kspice.cp312-win_amd64.pyd"),
    ("config.ini", "config.ini"),],"include_msvcr": True,}setup(name="demo",version="0.1",description="KSpice Demo",options={"build_exe": build_exe_options},executables=[Executable("demo.py")],)

  1. 打包:

    sh

    python setup.py build

  1. 把生成的 exe 和 .pyd 一起分发。


文章转载自:
http://racemule .zzyjnl.cn
http://ghettoize .zzyjnl.cn
http://brilliantly .zzyjnl.cn
http://discontinuation .zzyjnl.cn
http://forehandedly .zzyjnl.cn
http://depth .zzyjnl.cn
http://frieze .zzyjnl.cn
http://windlass .zzyjnl.cn
http://tantara .zzyjnl.cn
http://crossbred .zzyjnl.cn
http://haphazard .zzyjnl.cn
http://parve .zzyjnl.cn
http://collutory .zzyjnl.cn
http://compandor .zzyjnl.cn
http://quark .zzyjnl.cn
http://erythroblast .zzyjnl.cn
http://maskless .zzyjnl.cn
http://laudation .zzyjnl.cn
http://tribal .zzyjnl.cn
http://rajaship .zzyjnl.cn
http://retroreflective .zzyjnl.cn
http://gravelly .zzyjnl.cn
http://kc .zzyjnl.cn
http://matutinal .zzyjnl.cn
http://cloudwards .zzyjnl.cn
http://salangane .zzyjnl.cn
http://bophuthatswana .zzyjnl.cn
http://rvsvp .zzyjnl.cn
http://garut .zzyjnl.cn
http://cruller .zzyjnl.cn
http://www.dtcms.com/a/293964.html

相关文章:

  • Qt 数据QByteArray与QString处理与转换全指南
  • QT的moveToThread 用法
  • Java按模板导出Excel
  • LoRA 低秩矩阵实现参数高效的权重更新
  • 2025 ACT 汽车功能安全相关PPT分享
  • 《计算机网络》实验报告七 HTTP协议分析与测量
  • 【硬件-笔试面试题】硬件/电子工程师,笔试面试题汇总版,持续更新学习,加油!!!
  • 场效应管和模电的关于、学习
  • 【盘古100Pro+开发板实验例程】FPGA | Modelsim 的使用和 do 文件编写
  • SpringBoot 使用Rabbitmq
  • rust嵌入式开发零基础入门教程(一)
  • FSHNet:高效目标检测新突破
  • rust嵌入式开发零基础入门教程(五)
  • Python应用指南:构建和获取全球地铁线路数据及可视化
  • HarmonyOS学习记录5
  • 【形态学变换】——图像预处理(OpenCV)
  • (nice!!!)(LeetCode 每日一题) 1717. 删除子字符串的最大得分 (贪心)
  • 昨天去看了电科金仓的发布会,有点东西!
  • AI营销核心技术解析:运作机制与行业应用实例
  • 【软件系统架构】系列七:嵌入式系统性能深入解析
  • 华为云中,列表中的镜像无法删除可能由多种原因导致
  • 华为云开发者空间 × DeepSeek-R1 智能融合测评:云端开发与AI客服的协同进化
  • WPF的一些基础知识学习记录
  • 设计模式 八:原型模式 (Prototype Pattern)
  • Spring Boot全局异常处理:一网打尽Controller层异常,@RestControllerAdvice解析
  • 设计模式(单例)
  • 界面组件DevExpress WPF中文教程:Grid - 如何过滤节点?
  • Linux下SVN常用指令
  • 设计模式代码总结
  • Android MediaCodec 的使用和源码实现分析