Python print函数详解

 1 """
 2 print(...)
 3     print(value, ..., sep=' ', end='
', file=sys.stdout, flush=False)
 4 
 5     Prints the values to a stream, or to sys.stdout by default.
 6     Optional keyword arguments:
 7     file:  a file-like object (stream); defaults to the current sys.stdout.
 8     sep:   string inserted between values, default a space.
 9     end:   string appended after the last value, default a newline.
10     flush: whether to forcibly flush the stream.
11 
12 """
1 *values : 表示要打印的值 
表示任何多个无名参数, 各个值之间用‘,’(逗号隔开),打印出来各个值之间用空格隔开 
2 sep=' ' : 表示当输入多个打印的值时,各个值之间分割方式, 默认空格,可以自定义,
end=‘ ’**: 控制print中传入值输出完后结束符号,默认换行,这里可以设置为其他,如 ‘ ’, ’ ’ 等等, 可以自己定义
file=sys.stdout:设置输出设备,及把print中的值打印到什么地方,默认输出到准端,可以设置file= 文件储存对象,把内容存到该文件中
flush=False: 该参数主要是刷新, 默认False,不刷新,Ture时刷新,
Nobody knows it better than me.
原文地址:https://www.cnblogs.com/dadaizi/p/11964723.html