python 常用函数举例
来源:互联网 发布:拆分资金盘 源码 编辑:程序博客网 时间:2024/05/17 23:41
1 apply 函数
def printInfo(id,name,address):
print 'id is ',id,' and name is ',name,' and address is ',address
1.1 调用printInfo函数
printInfo(1,'flankwang','HeNan KaiFeng')
1.2 调用printInfo函数
apply(printInfo,(1,'flankwang','HeNan KaiFeng'))
1.1 和1.2效果一样
2 __call__ 函数
class CallDemo(object):
def __init__(self):
print 'this is __init__ method'
def __call__(self):
print 'this is __call__ method'
调用:
CallDemo()()
结果:
this is __init__ method
this is __call__ method
- python 常用函数举例
- python入门笔记---常用函数举例和总结
- 常用函数举例
- python的函数举例
- PHP header()函数 常用举例
- 常用数字函数简单举例
- python下的socket常用方法举例
- 几个常用sql函数使用举例
- Matlab常用函数举例(一)
- Matlab常用函数举例(二)
- Matlab常用函数举例(三)
- Matlab常用函数举例(四)
- Matlab常用函数举例(五)
- Matlab常用函数举例(六)
- Matlab常用函数举例(七)
- Matlab常用函数举例(八)
- Matlab常用函数举例(九)
- Matlab常用函数举例(十)
- Robberies hdu2955 01背包
- zookeeper学习记录(转自 ITeye)
- 线段树
- Dshow--分析点播命令
- cookie操作,setCookie,getCookie,delCookie
- python 常用函数举例
- oracle rollup和cube分析
- ebs克隆新环境form端口占用问题解决
- 使用jq和flip插件来做了一个幻灯片翻转效果小demo
- Gmap.net开发资料搜集
- stretchableImageWithLeftCapWidth的使用
- PhraseQuery slop
- oracle 集操作和exists、in的运用场景
- SVN Windows下SVN服务器的搭建