繁体   English   中英

使用 PyInstaller 将带有命令行参数的 Python 程序转换为可执行文件

[英]Converting Python program with command line argument into executable using PyInstaller

我想使用 pyInstaller 将带有命令行参数的 python 代码转换为 Windows 可执行文件。 我运行我的python程序如下

python myPython 1

首先,我想知道您在 Google 搜索中没有获得与此相关的文章。

首先通过运行此命令安装 pyinstaller

pip install pyinstaller

如需其他帮助https://pyinstaller.readthedocs.io/en/stable/installation.html

打开命令提示符,现在导航到您的 python 文件(使用 cd 命令)所在的目录,然后输入代码

pyinstaller --onefile .py

这将创建一个独立的可执行文件(我希望你会问)。 以下是您错过阅读的 stackoverflow 问题的链接。 编辑:在同一目录中,将创建一个名为 dist 的文件夹,其中包含您的单个可执行文件。

如何将 .py 转换为 Python 的 .exe?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM