Skip to content

Commit

Permalink
lesson-3
Browse files Browse the repository at this point in the history
lesson-3
  • Loading branch information
Jack-Cherish authored May 5, 2020
1 parent 717dd87 commit 747363e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Pytorch-Seg/lesson-3/log.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import sys
class Logger():
def __init__(self, filename="log.txt"):
self.terminal = sys.stdout
self.log = open(filename, "w")

def write(self, message):
self.terminal.write(message)
self.log.write(message)

def flush(self):
pass

sys.stdout = Logger()

print("Jack Cui")
print("https://cuijiahua.com")
print("https://mp.weixin.qq.com/s/OCWwRVDFNslIuKyiCVUoTA")

0 comments on commit 747363e

Please sign in to comment.