This article describes how to use python to generate executable windows.ProgramAnd port it to other environments without python.
The previous article briefly introduced how to package the command line program: Windows environment, Python package the command line program.
The program list is as follows:
E: \ projects_python \ simplewindow \ window. pyw (source program)
# window.pyw import wx
app = wx.App()
win = wx.Frame(None)
win.Show()
app.MainLoop()
Note: If the extension of the same file is py, a command line window will appear at startup, which is quite uncomfortable. If it is changed to pyw, the command line window will no longer appear.
E: \ projects_python \ simplewindow \ setup. py (installation script)
import py2exe
from distutils.core import setup
#setup(windows=["E://projects_python//simplewindow//window.pyw"]) // If such a simple script is not enough, an error will be reported: msvcp90.dll is missing. Because the window program uses msvcp90.dll.
setup(
options = {
"py2exe": {
"dll_excludes": ["MSVCP90.dll"],
}
},
windows=[{"script": "E://projects_python//simplewindow//window.pyw"}]
)
The installation process is the same as that of the Windows environment.
In the same example, the simplewindow.exe directory will generate a distdirectory with the same name as window. pyw. This is an executable program.