使print既打印到终端,又写入文件 class Tee(object): def __init__(self,*files): self.files = files def write(self,obj): for f in self.files: f.write(obj) if __name__ == '__main__': logname = './new_file.txt' with open(logname,'w') as logfile: original = sys.stdout…
shell http://baike.baidu.com/link?url=qN3THt5ZJhQtwRJJkakWdz5-vZp4V9H3OmNP97XNhaoL-dqU-6rrFrYfHXmYv60td49ZsVxDHF8lTwPC3zK_C8-nWCBgy8sRV_9uqqcczeu Linux Shell http://baike.baidu.com/link?url=2LxUhKzlh5xBUgQrS0JEc61xi761nvCS7SHJsa1U1SkVbw3CC869AoUCyKT0…