First
#WindowsXP-KB942288-v3-x86.exe(for msi install update)
#python-2.6.x4.msi(for python 2.6)
#wxPython2.8-win32-unicode-2.8.10.1-py26.exe(for gui)
#vcredist_x86.exe(for vc++ 2008 runtime)
#py2exe-0.6.9.win32-py2.6.exe(build .py firle to exe)
######################################
#firstWxPython.py
import sys, os
import wx
class main_window(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, -1, title, size = (200, 100),style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
self.control = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE)
self.Show(True)
class App(wx.App):
def OnInit(self):
frame = main_window(None, -1, "wxPython: (A Demonstration)")
self.SetTopWindow(frame)
return 1
app = App(0)
app.MainLoop()
####################################################
#mysetup.py
from distutils.core import setup
import py2exe
setup(
windows = [
{
"script": "firstWxPython.py",
"icon_resources": [(1, "app.ico")]
}
],
)
::usePy2exe.bat
c:python26python mysetup.py py2exe
#now excute usePy2exe.bat waiting for build the exe
#and then in dist directory, run firstWxPython.exe
#and firstWxPython.exe depend on the other files(some exe and dll etc.) in this directory.
Second
#WindowsXP-KB942288-v3-x86.exe(for msi install update)
#python-2.4.2.msi(for python 2.4)
#pywin32-214.win32-py2.4.exe(for some win32 support)
#wxPython2.8-win32-ansi-2.8.10.1-py24.exe(maybe should use unicode version)(for gui)
#pyinstaller_1.3.zip(for build .py file to exe) (extract to some directory eg. C:pyinstaller-1.3)
::myPyinstaller.bat
c:python24python c:pyinstaller-1.3configure.py
c:python24python c:pyinstaller-1.3Makespec.py firstWxPython.py –onefile –windowed –icon=app.ico
c:python24python c:pyinstaller-1.3build.py firstWxPython.spec
#then run firstWxPython.exe,just one exe,some kind of slower