Since most of the basics have been learned in the early stages, it is an intermediate stage for an in-depth understanding of the basics and Python usage. Open the first article on the GUI-related, in order to strengthen the sensory understanding.
1. What is Wxpython
is a Python GUI toolkit.
Download path: https://www.wxpython.org. Automatic Update download can also be done via PIP3 install-u Wxpython
2.wxpython Foundation
2.1 window (QQ instance)
Create an Application object: Qq=w X.app ()
Create an application to display the window windows=wx. Frame (none,title= "application title", size= (long, wide))
Make the window you have created visible: Windows. Show (True)
Enter the management loop of the application (exit until close): QQ. Mainloop ()
Add a control to a known window: Button=wx. Button (windows,pos= (long, wide), size (long, wide))
Add an event on a known control: button. Bind (WX. Evt_button, event or function method)
2.2 Layout Management
Because the control is placed in POS and the control itself sizes size size, it is not possible to adapt the window (Windows) changes, add the Pannel panel to differentiate the area (the menu bar, the status bar, etc.) can be distinguished.
Create panels to differentiate window blocks: panel=wx. Panel (Windows)
Create window block: box=wx. Boxsizer ()
Sets the absolute position of the window block and whether it can be stretched, box. ADD (self.button,proportion=1,flag=wx. EXPAND)
3. Calculator example (use Wxpython to write a simple calculator)
--and so on after the completion of the update--it seems to be written directly some difficulty, need to train constructors, classes, overloads and other related knowledge---
Python Learning Note Phase II Gui-wxpython