Installation file Preparation:
installation files |
Download Address |
Python-2.6.2.msi |
http://www.python.org/download/ |
Wxpython2.8-win32-unicode-2.8.10.1-py26.exe Wxpython2.8-win32-docs-demos-2.8.10.1.exe |
http://www.wxpython.org/download.php |
Py2exe-0.6.9.win32-py2.6.exe |
http://sourceforge.net/projects/py2exe/files/ |
Eclipse-sdk-3.3.2-win32.zip |
http://archive.eclipse.org/eclipse/downloads/index.php |
Org.python.pydev.feature-1.4.7.2843.zip |
Http://pydev.sourceforge.net/download.html |
Python and WxPython Operating environment installation
Install Python-2.6.2.msi, Wxpython2.8-win32-unicode-2.8.10.1-py26.exe, respectively
Wxpython2.8-win32-docs-demos-2.8.10.1.exe and Py2exe-0.6.9.win32-py2.6.exe
The Python installation path takes the default C:\Python26, and after installation, adds this directory to the PATH environment variable
Pydev Development Environment Installation
If you do not have the JRE installed, go to www.java.com to download the installation
Extract Eclipse-sdk-3.3.2-win32.zip to D:\eclipse-3.3.2
Extract Org.python.pydev.feature-1.4.7.2843.zip to D:\eclipse-3.3.2\pydev-1.4.7\eclipse
Create a folder "links" under D:\eclipse-3.3.2\eclipse and create a file under the folder Pydev-1.4.7.link
Open Pydev-1.4.7.link with Notepad, enter: path=d:/eclipse-3.3.2/pydev-1.4.7
The unpacked directory structure is as follows:
Copy Code code as follows:
D:\
+eclipse-3.3.2
|--+eclipse
| |--+configuration
| |--+features
| |--+links
| |--+plugins
| |--+readme
| |---eclipse.exe
|
|--+pydev-1.4.7
|--+eclipse
|--+features
|--+plugins
Run and configure Pydev
Double-click D:\eclipse-3.3.2\eclipse\eclipse.exe to run Eclipse, select a workspace, after loading,
Open menu: Window >> Preferences ..., in the pop-up dialog box, into Pydev >> Interpreter–python,
Clicking Auto Config automatically loads the Python run environment configuration
Developing Wxpython applications
Create a new Pydev project:proj1, and then create a new Pydev Module:app1.py, enter the code:
Import WX
If __name__ = = ' __main__ ':
app = wx. Pysimpleapp ()
frame = wx. FRAME (Parent=none)
frame. Show (True)
app. Mainloop ()
Right-click app1.py and choose Debug as >> python run to run
Convert Python script to exe
New module: convert2exe.py, enter code:
From Distutils.core Import setup
import py2exe
Setup (windows=[{"script": "app1.py"}])
Then run the Windows DOS command line, switch directories to the PROJ1/SRC directory, and enter the command:
Python convert2exe.py Py2exe
Python generates Dist folders and copies resources such as dependent DLLs into this directory, generating App1.exe
Double-click App1.exe to run
Documentation and learning materials
Python and WxPython have their own API documentation, which can be found in the Start menu
Concise Python Tutorials http://www.woodpecker.org.cn : 9081/doc/abyteofpython_cn/chinese/
WxPython in action http://wiki.woodpecker.org.cn/moin/ Wxpythoninaction