This article describes the Python implementation of a given class of virtual function method, shared for everyone to reference. Specifically as follows:
Now take a look at the following code:
Import wx for method in
dir (wx. Pypanel): #这里改成给定的类
if Method.startswith ("Base_"):
Print method
The results of the output are:
Base_acceptsfocus
base_acceptsfocusfromkeyboard
base_addchild
base_dogetbestsize
base_ Dogetclientsize
base_dogetposition
base_dogetsize
base_dogetvirtualsize
Base_domovewindow
base_dosetclientsize
base_dosetsize
base_dosetvirtualsize
base_enable
base_ Getdefaultattributes
base_getmaxsize
base_initdialog
base_oninternalidle
base_removechild
base_shouldinheritcolours
base_transferdatafromwindow
base_transferdatatowindow
base_ Validate
Attached is a commonly used str method, the official document is as follows:
Str.startswith (Prefix[,start[,end]])
return True If string starts with Theprefix, otherwise returnfalse.prefix can also is a tuple of prefixes to . With Optionalstart, test string beginning in that position. With Optionalend, stop comparing string in that position.
If string starts with prefix, the function returns True.
I hope this article will help you with your Python programming.