下面应该可以解你的惑了: print >> sys.stdout的形式就是print的一种默认输出格式,等于print "%VALUE%" 看下面的代码的英文注释,是print的默认帮助信息 # coding=utf-8 import sys, os list1Display = ['] list2Display = ['abc', 'def', 'rfs'] while list2Display != []: # Prints the values to a stream
sys.stdout 和 print 的区别 首先,通过 help(print) 得到print内建函数的参数 Help on built-in function print in module builtins: print(...) print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Opti
1. 先看下官方文档 """ sys.stdout.write(string) Write string to stream. Returns the number of characters written (which is always equal to the length of the string). print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the valu