2017年3月2日
摘要: 静态方法 @staticmethod # 实际上跟类没关系了 class Dog(): def __init__(self,name) self.name = name @staticmethod def eat(self,food) print("{} is eating {}".format(s 阅读全文
posted @ 2017-03-02 23:12 江米条的挽歌 阅读(122) 评论(0) 推荐(0)
摘要: subprocess模块 ret = os.system("command") 输出命令的结果,但是只返回命令的执行状态,因此ret的值在正常返回为0,不正常为非0 ret = os.popen("command").read() 此命令返回命令执行的结果,ret是命令的输出,但是没有执行状态 im 阅读全文
posted @ 2017-03-02 23:09 江米条的挽歌 阅读(214) 评论(0) 推荐(0)