现来看看如下代码:
import wx for method in dir(wx.PyPanel): #这里改成给定的类 if method.startswith("base_"): print method输出的结果为:
Return True if string starts with theprefix, otherwise returnFalse.prefix can also be a tuple of prefixes to look for. With optionalstart, test string beginning at that position. With optionalend, stop comparing string at that position.
如果string以prefix开头前端技巧官方文档如下:
str.startswith(prefix[,start[,end]])
如果string以prefix开头函数返回True.