py文件转可执行文件

使用Python官方提供的pyinstaller库。

pip3 install pyinstaller
pyinstaller -F nameofpy (-n nameofoutput)

使用示例
在hello.py所在目录下执行pyinstaller -F hello.py会在目录中产生dist文件夹,下有名为hello的可执行文件(不指定输出名时默认为py文件前缀)。
当然也可以执行pyinstaller -F hello.py -n hello1,会在目录中产生dist文件夹,下有名为hello1的可执行文件。
使用方式:python3 hello.py argu1 argu2等同于./hello argu1 argu2

本文作者:心比天高xzh

本文链接:https://www.cnblogs.com/xzh-personal-issue/p/17240203.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   心比天高xzh  阅读(20)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起