原英文帮助文档:

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)

Print objects to the text stream file, separated by sep and followed by end. sep, end, file and flush, if present, must be given as keyword arguments.

All non-keyword arguments are converted to strings like str() does and written to the stream, separated by sep and followed by end. Both sep and end must be strings; they can also be None, which means to use the default values. If no objects are given, print() will just write end.

The file argument must be an object with a write(string) method; if it is not present or None, sys.stdout will be used. Since printed arguments are converted to text strings, print() cannot be used with binary mode file objects. For these, use file.write(...) instead.

Whether output is buffered is usually determined by file, but if the flush keyword argument is true, the stream is forcibly flushed.

Changed in version 3.3: Added the flush keyword argument.

————————(我是分割线)————————

中文解释:

print(*objectssep=' 'end='\n'file=sys.stdoutflush=False)

将对象打印到文本流文件中,用sep分隔,后跟end。sep、end、file和flush(如果存在)必须作为关键字参数给定。

所有非关键字参数都转换为str()那样的字符串,并写入流中,用sep分隔,后跟end。sep和end都必须是字符串;它们也可以是none,这意味着使用默认值。如果没有给定对象,print()将只写结束。
file参数必须是具有write(string)方法的对象;如果不存在或没有,则将使用sys.stdout。由于打印的参数被转换为文本字符串,print()不能用于二进制模式的文件对象。对于这些,请改用file.write(…)。
输出是否缓冲通常由文件决定,但如果flush关键字参数为true,则强制刷新流。
在版本3.3中更改:添加了flush关键字参数。

————————(我是分割线)————————

python print输出延时,让其立刻输出

一句print("ni hao"),很久看不见,怎么让python print能立刻输出呢。

因为python默认是写入stdout缓冲的,使用-u参数启动python,就会立刻输出了。

python3 -u driver.py

————————(我是分割线)————————

参考:

1. Python 3.7.2 documentation

2. RUNOOB.COM:

https://www.runoob.com/python/python-func-print.html

https://www.runoob.com/w3cnote/python3-print-func-b.html

3.

备注:

初次编辑时间:2019年9月22日17:04:59

环境:Windows 7   / Python 3.7.2

最新文章

  1. oracle迁移postgres之-Ora2Pg
  2. 配置iDempiere源码开发环境
  3. 团队作业--Beta版本冲刺
  4. C# 请求外部服务的办法
  5. Android与Asp.Net Web服务器的文件上传下载BUG汇总[更新]
  6. 黑马程序员 1、C语言32个关键字整理分类
  7. 关于Hibernate数据库连接进程释放
  8. 2017-2018-1 20155205 实现mypwd
  9. 拥抱开源,Office 365开发迎来新时代
  10. JsTree 最详细教程及完整实例
  11. vw, vh视区覆盖和自适应图片
  12. Net-SNMP V3协议 安装配置笔记(CentOS 6.3/5.6)
  13. STL基础--算法(不修改数据的算法)
  14. multiset多重集合容器(常用的使用方法总结)
  15. DIOCP开源项目-DIOCP3 大文件的传输DEMO<断点续传>
  16. asp.net 退出登陆(解决退出后点击浏览器后退问题仍然可回到页面问题)
  17. 如何看待阿里 AI 每秒制作 8000 张海报?
  18. python流行的原因
  19. 在定时任务中慎用pause,否则造成弹窗没关闭,下一次任务不会成功执行
  20. 大于号转义符>---小于号转义符<

热门文章

  1. 多线程:Thread类的Join()方法
  2. [SDOI2006]最短距离
  3. HDU - 6150 构造题
  4. 在docker容器中python3.5环境下使用DIGITS训练caffe模型
  5. vmware 中Linux系统怎么连接外网?
  6. 2018-2019-2 20165330《网络对抗技术》Exp9 Web安全基础
  7. Linux设备驱动程序 之 read和write
  8. python操作s3 -- boto2.x
  9. mysql5.7 彻底解决sql_mode=only_full_group_by
  10. MySQL存储引擎及数据库的操作管理