摘要: >>> for i in range(0,10): if i > 10: break; else: print "hello world"; 输出:hello world >>> for i in range(0,10): if i > 5: break; else: print "hello wo 阅读全文
posted @ 2017-11-02 21:32 wangmo 阅读(161) 评论(0) 推荐(0) 编辑
摘要: open/文件操作f=open('/tmp/hello','w')#open(路径+文件名,读写模式)#读写模式:r只读,r+读写,w新建(会覆盖原有文件),a追加,b二进制文件.常用模式如:'rb','wb','r+b'等等 读写模式的类型有: rU 或 Ua 以读方式打开, 同时提供通用换行符支 阅读全文
posted @ 2017-11-02 17:41 wangmo 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 作者:李保银链接:https://www.zhihu.com/question/20021164/answer/18224953来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 普通方法,静态方法和类方法 这个答案的原文是Difference between @stat 阅读全文
posted @ 2017-11-02 16:42 wangmo 阅读(3974) 评论(0) 推荐(0) 编辑