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

首頁 > 編程 > Python > 正文

python實現得到一個給定類的虛函數

2019-11-25 18:11:01
字體:
來源:轉載
供稿:網友

本文實例講述了python實現得到一個給定類的虛函數的方法,分享給大家供大家參考。具體如下:

現來看看如下代碼:

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

輸出的結果為:

base_AcceptsFocusbase_AcceptsFocusFromKeyboardbase_AddChildbase_DoGetBestSizebase_DoGetClientSizebase_DoGetPositionbase_DoGetSizebase_DoGetVirtualSizebase_DoMoveWindowbase_DoSetClientSizebase_DoSetSizebase_DoSetVirtualSizebase_Enablebase_GetDefaultAttributesbase_GetMaxSizebase_InitDialogbase_OnInternalIdlebase_RemoveChildbase_ShouldInheritColoursbase_TransferDataFromWindowbase_TransferDataToWindowbase_Validate 

另附一個常用的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開頭,函數返回True.

希望本文所述對大家的Python程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 莱芜市| 莱西市| 贵溪市| 白水县| 白银市| 怀集县| 砚山县| 清水河县| 密山市| 宜阳县| 阳曲县| 比如县| 麻城市| 屏山县| 锦屏县| 布尔津县| 荔浦县| 陵水| 衢州市| 阿巴嘎旗| 陇西县| 宁陕县| 鹤山市| 盖州市| 锦屏县| 句容市| 广灵县| 石阡县| 聂拉木县| 沈丘县| 平顺县| 灵宝市| 日喀则市| 信阳市| 南丹县| 南丰县| 龙游县| 蒲江县| 定结县| 禄劝| 曲水县|