国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > Python > 正文

python實(shí)現(xiàn)得到一個(gè)給定類的虛函數(shù)

2020-02-23 05:53:21
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了python實(shí)現(xiàn)得到一個(gè)給定類的虛函數(shù)的方法,分享給大家供大家參考。具體如下:

現(xiàn)來(lái)看看如下代碼:

import wx for method in dir(wx.PyPanel):   #這里改成給定的類   if method.startswith("base_"):     print method 

輸出的結(jié)果為:

base_AcceptsFocusbase_AcceptsFocusFromKeyboardbase_AddChildbase_DoGetBestSizebase_DoGetClientSizebase_DoGetPositionbase_DoGetSizebase_DoGetVirtualSizebase_DoMoveWindowbase_DoSetClientSizebase_DoSetSizebase_DoSetVirtualSizebase_Enablebase_GetDefaultAttributesbase_GetMaxSizebase_InitDialogbase_OnInternalIdlebase_RemoveChildbase_ShouldInheritColoursbase_TransferDataFromWindowbase_TransferDataToWindowbase_Validate 

另附一個(gè)常用的str的方法,官方文檔如下:
str.startswith(prefix[,start[,end]])

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開(kāi)頭,函數(shù)返回True.

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 瑞金市| 都安| 隆化县| 昌黎县| 海原县| 逊克县| 遵化市| 鹤岗市| 兴国县| 南澳县| 若尔盖县| 梧州市| 汕头市| 丹阳市| 长海县| 巴彦淖尔市| 重庆市| 乐山市| 余干县| 托里县| 诏安县| 大理市| 凯里市| 蓝田县| 察隅县| 台中县| 南部县| 同德县| 仙游县| 商河县| 宿迁市| 罗城| 马山县| 广饶县| 塘沽区| 司法| 九江市| 酒泉市| 吉木萨尔县| 高台县| 黑山县|