xlwings python实现代码的部署--exe文件

RunFrozenPython#

Changed in version 0.15.2.

You can use a freezer like PyInstaller, cx_Freeze, py2exe etc. to freeze your Python module into an executable so that the recipient doesn’t have to install a full Python distribution.

Note

  • This does not work with UDFs.

  • Currently only available on Windows, but support for Mac should be easy to add.

  • You need at least 0.15.2 to support arguments whereas the syntax changed in 0.15.6

Use it as follows:

Sub MySample()
    RunFrozenPython "C:\path\to\dist\myproject\myproject.exe", "arg1 arg2"
End Sub

(一)pycharm 打包py成可执行文件.exe ,使用pyinstaller

1、安装pyInstaller解释器

2、右键你自己的代码(我的叫:helloworld2.py),打开终端

3、在下方的terminal中执行命令:pyinstaller -F helloworld2.py,生成.exe文件

(二)在xlsm中修改VBA脚本 RunFrozenPython,注意 .exe文件的路径

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值