国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 专栏| 博湖县| 黄山市| 郁南县| 永兴县| 安福县| 南靖县| 大厂| 永顺县| 平山县| 错那县| 北宁市| 闽侯县| 正阳县| 同德县| 扶余县| 重庆市| 安远县| 团风县| 濮阳市| 柞水县| 九龙县| 察隅县| 南陵县| 古浪县| 全南县| 宜章县| 金塔县| 东乡族自治县| 句容市| 百色市| 盐津县| 鄂温| 大理市| 荥阳市| 亚东县| 黎城县| 威远县| 图片| 邢台市| 苍溪县|