您的位置:首页 > 编程语言 > Python开发

python 学习笔记(十五)

2014-12-23 18:00 351 查看
# coding=utf8
__author__ = 'liwei'
'导入type13_1.py模块'
from type13_1 import Hello

h=Hello()
h.hello()
'查看类型'
print(type(Hello))
print(type(h))
print(type(h.hello()))
'使用type()函数创建类,的用法'
print('使用type()函数创建类,的用法')

def fn(self,name='word'):
print('hello %s'%name)
'type函数创建Hello类'
Hello1=type('Hello1',(object),dict(hello=fn))
#有问题
# w=Hello()
# w.hello()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: