I'm stupid

This commit is contained in:
litagin02
2023-12-30 10:03:30 +09:00
parent 35a8bb514f
commit 85e9374c04

17
tools/stdout_wrapper.py Normal file
View File

@@ -0,0 +1,17 @@
import sys
class StdoutWrapper:
def write(self, message: str):
print(message, end="")
def flush(self):
pass
def get_stdout():
# Colab 環境をチェックする
if "google.colab" in sys.modules:
return StdoutWrapper()
else:
return sys.stdout