print() 方法的语法: print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) 其中file = sys.stdout的意思是,print函数会将内容打印输出到标准输出流(即 sys.stdout),当然也可以自定义输出流: with open('test.log', 'a') as f: print('hello world!', file=f) # 内容输出到了test.log文件中,终端不会打印任何内容 也可以…