#!/usr/bin/env python #-*-coding:utf8-*- def bulk(self): print("%s is jiao ...."%self.name) class Dog(object): def __init__(self,name): self.name=name ...
分类:
编程语言 时间:
2020-02-20 14:51:36
阅读次数:
71
python学习反射实例1脚本内容如下:#coding:utf8classmyClass(object):deffax(self):print‘faxing....‘defcopy(self):print‘copying...‘defprinting():print‘printing....‘m=myClass()ifhasattr(m,‘fax‘):#判断myClass类中是否有fax方法func=getattr(m,‘fax‘)#返回内存对象func..
分类:
编程语言 时间:
2017-06-07 14:33:12
阅读次数:
145