摘要:
对于面向对象总是要提到,万物皆对象。好似博大精深的感觉。接下来一起看看python的面向对象的例子创建一个对象 class Person: type = 'person' def __init__(self, name = 'Noname'): self.name = name def h... 阅读全文
摘要:
关于python的编码问题一直以来不得解,终于在今天从这篇博文中明白了。原文地址:http://nedbatchelder.com/text/unipain.html译文地址:http://pycoders-weekly-chinese.readthedocs.org/en/latest/issue... 阅读全文
摘要:
python 的处理错误的方式:1> 断言 assert condition 相当于 if not condition: crash program 断言设置的目的就是因为与其让程序晚点崩溃,不如直接设置错误情况,让它直接崩溃 >>> age = -1 ... 阅读全文