简体   繁体   English

如何使用py2exe将python3.4脚本(已安装模块)转换为Windows可执行文件?

[英]How do i convert a python3.4 script(that has installed modules) into a windows executable using py2exe?

I have a python script that i have to import all these modules, which some of them require downloading: 我有一个python脚本,我必须导入所有这些模块,其中一些模块需要下载:

import datetime
from dateutil import parser
from tkinter import filedialog
import tkinter
import mailbox
import pprint
import json
import urllib.request
from tkinter import *

Is there a way, using py2exe, i can convert the script into a windows executable. 有没有办法,使用py2exe,我可以将脚本转换为Windows可执行文件。 If so, how? 如果是这样,怎么样?

To simplify the procedure, you will want to have all your modules already downloaded. 为了简化过程,您将需要下载所有模块。 This can be accomplished with a simple "pip install " from command prompt. 这可以通过从命令提示符处进行简单的“ pip install”来完成。 Then it is as simple as writing and running a setup.py file - detailed directions for how to do this can be found here . 然后,就像编写和运行setup.py文件一样简单,有关如何执行此操作的详细说明,请参见此处

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

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