Redirects prints to file

2019-06-16 02:08栏目:技术创新

x = 99

y = 'Hi'

import sys
sys.stdout = open('log.txt', 'a')     # redirects prints to file

print x, y, x                         # shows up in log.txt

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:Redirects prints to file