print console sys.stdout code example
Example: print console sys.stdout
sys.stdout = open("test.txt", "w")
print("Hello World")
sys.stdout.close()
# TEST.TXT:
# Hello World
sys.stdout = open("test.txt", "w")
print("Hello World")
sys.stdout.close()
# TEST.TXT:
# Hello World