Recently, I am interested in Python development. I have been stuck on a surface layer for python development.
Python is easy to start with, and its syntax is easy to understand. It comes with mature class libraries for network communication and open-source packages developed by third parties.
In GUI development, Python has a tkinter library and a third-party library (such as wxpython and QT)
Today, we will briefly introduce how to build and use the wxpython development environment.
Use the development environmentWxformbuilder + uipad + wxpython,Install in sequence
Python 2.6:Http://www.python.org/download/releases/2.6.7/
Wxpython 2.8:Http://www.wxpython.org/download.php#stable
Wxformbuilder 3.2 BETA:Http://sourceforge.net/projects/wxformbuilder/
Uicontrol 4.0:Http://www.onlinedown.net/soft/101104.htm
Python GUI program development steps
1. wxformbuilder Interface Design Process
I will not describe it here. You can use the wxpython interface design method under Baidu.
2. After the interface design is complete, respond to the button event
As shown in, a response event is generated.Code
3. After event ing, copy the Python code to the py file.
4. Use ulipad to edit the py file
Add the app initialization code at the end of The py file, and add the response code to the corresponding event.
1 ClassAPP (wx. app ):
2DefOninit (Self ):
3Frame = myframe1 (none) # The frame class name of the GUI is generated here.
4Frame. Show ()
5ReturnTrue
6
7APP = app ()
8
9App. mainloop ()
5. Run the py file
First wxpython InterfaceProgramThis is done here. If you are interested, you can perform further research.
Python-related learning materials:
Wxpython-in-action
Wxpython. API reference manual
Go deep into Python Chinese version-2.5