python – 有没有办法指定py2exe的build目录
发布时间:2020-09-18 23:35:51 所属栏目:Python 来源:互联网
导读:我可以使用命令行设置py2exe的最终dist目录: python setup.py py2exe -d my/dist/dir 但我似乎无法将该文件设置为临时构建目录.我简要地看了一下这个来源,但是除非我错过了一些事情,似乎没有任何办法. 您可以在命令行中设置的任何选项可以通过 setup.cfg文件
我可以使用命令行设置py2exe的最终dist目录: python setup.py py2exe -d "my/dist/dir" 但我似乎无法将该文件设置为临时构建目录.我简要地看了一下这个来源,但是除非我错过了一些事情,似乎没有任何办法. 解决方法您可以在命令行中设置的任何选项可以通过 setup.cfg文件或setup.py文件进行设置.-d是-dist-dir的快捷方式,您可以将其添加到传递给设置为“dist_dir”的options关键字参数的字典中的py2xe dict中: from distutils.core import setup import py2exe # equivalent command line with options is: # python setup.py py2exe --compressed --bundle-files=2 --dist-dir="my/dist/dir" --dll-excludes="w9xpopen.exe" options = {'py2exe': { 'compressed':1,'bundle_files': 2,'dist_dir': "my/dist/dir" 'dll_excludes': ['w9xpopen.exe'] }} setup(console=['myscript.py'],options=options) 您也可以将setup.cfg放在setup.py文件旁边: [py2exe] compressed=1 bundle_files=2 dist_dir=my/dist/dir dll_excludes=w9xpopen.exe 构建目录(–build-base)是构建命令的一个选项,因此您可以将其添加到其中一个配置文件(或setup.py)中: [build] build_base=my/build/dir (编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- python – Pandas读取sql整数变为浮点数
- python – Django get_or_create和ManytoManyFie
- python – Pandas isna()和isnull(),有什么区别?
- Python 版的 try-with-resources——with 上下文
- python – 从defaultdict获取原始密钥集
- python – AttributeError:’str’对象没有属性
- python请求链接头
- python – 在多处理函数上超时装饰器
- python – 在Flask-Login中使用的“is_authentic
- 在没有busywait的情况下在python中实现亚毫秒处理
热点阅读