原英文帮助文档:

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

【Python】【基础知识】【内置函数】【print的使用方法】的更多相关文章

  1. 十六. Python基础(16)--内置函数-2

    十六. Python基础(16)--内置函数-2 1 ● 内置函数format() Convert a value to a "formatted" representation. ...

  2. 十五. Python基础(15)--内置函数-1

    十五. Python基础(15)--内置函数-1 1 ● eval(), exec(), compile() 执行字符串数据类型的python代码 检测#import os 'import' in c ...

  3. python基础(15):内置函数(一)

    1. 内置函数 什么是内置函数? 就是python给你提供的,拿来直接⽤的函数,比如print,input等等,截⽌到python版本3.6.2 python⼀共提供了68个内置函数.他们就是pyth ...

  4. python基础(内置函数+文件操作+lambda)

    一.内置函数 注:查看详细猛击这里 常用内置函数代码说明: # abs绝对值 # i = abs(-123) # print(i) #返回123,绝对值 # #all,循环参数,如果每个元素为真,那么 ...

  5. Python基础:内置函数

    本文基于Python 3.6.5的标准库文档编写,罗列了英文文档中介绍的所有内建函数,并对其用法进行了简要介绍. 下图来自Python官网:展示了所有的内置函数,共计68个(14*4+12),大家可以 ...

  6. 第六篇:python基础_6 内置函数与常用模块(一)

    本篇内容 内置函数 匿名函数 re模块 time模块 random模块 os模块 sys模块 json与pickle模块 shelve模块 一. 内置函数 1.定义 内置函数又被称为工厂函数. 2.常 ...

  7. Python基础编程 内置函数

    内置函数 内置函数(一定记住并且精通) print()屏幕输出 int():pass str():pass bool():pass set(): pass list() 将一个可迭代对象转换成列表 t ...

  8. Python基础_内置函数

        Built-in Functions     abs() delattr() hash() memoryview() set() all() dict() help() min() setat ...

  9. python基础(16):内置函数(二)

    1. lamda匿名函数 为了解决⼀些简单的需求⽽设计的⼀句话函数 # 计算n的n次⽅ def func(n): return n**n print(func(10)) f = lambda n: n ...

  10. 学习PYTHON之路, DAY 4 - PYTHON 基础 4 (内置函数)

    注:查看详细请看https://docs.python.org/3/library/functions.html#next 一 all(), any() False: 0, Noe, '', [], ...

随机推荐

  1. mysql被收购 用mariadb

    ~]# systemctl start mysql.service 要启动MySQL数据库是却是这样的提示 Failed to start mysqld.service: Unit not found ...

  2. Atcoder ABC138

    Atcoder ABC138 A .Red or Not 一道网速题. 大于3200输出原字符串,否则就输出red. #include<iostream> #include<cstd ...

  3. HDFS CheckPoint && SavePoint

    HDFS CheckPoint && SavePoint 标签(空格分隔): Hadoop HDFS CheckPoint HDFS 将文件系统的元数据信息存放在 fsimage 和一 ...

  4. docker安装Elasticsearch Kibana和Cerebro

    环境:win10家庭版,基于Docker Toolbox 首先先做好以下两步准备工作: ①.打开Oracle VM VirtualBox,设置虚拟机内存大小,默认不够安装,建议如下设置: ②.启动虚拟 ...

  5. Install chocolatey

    Requirements Windows 7+ / Windows Server 2003+ PowerShell v2+ .NET Framework 4+ (the installation wi ...

  6. LeetCode 84. 柱状图中最大的矩形(Largest Rectangle in Histogram)

    题目描述 给定 n 个非负整数,用来表示柱状图中各个柱子的高度.每个柱子彼此相邻,且宽度为 1 . 求在该柱状图中,能够勾勒出来的矩形的最大面积. 以上是柱状图的示例,其中每个柱子的宽度为 1,给定的 ...

  7. vs2017中信号与槽连接

    在vs2012里和在Qt Creator里添加信号和槽不一样,这里把两种环境下怎么添加详细说明一下 1.在vs2012里添加信号和槽 新建一个qt的项目QtDemo 在qtdeom.h里添加槽 pri ...

  8. 自定义vue-cli生成项目模板配置(1)

    最近在读<变量>,目前得到的认知之一:慢变量才是决定事物长期发展的因素. 打算自定义vue-cli的脚手架或者根据自己的需要设置项目模板的相关参数,很大程度与慢变量这个概念相关. 当然,我 ...

  9. MySQL(逻辑分层,存储引擎,sql优化,索引优化以及底层实现(B+Tree))

    一 , 逻辑分层 连接层:连接与线程处理,这一层并不是MySQL独有,一般的基于C/S架构的都有类似组件,比如连接处理.授权认证.安全等. 服务层:包括缓存查询.解析器.优化器,这一部分是MySQL核 ...

  10. centos6里面装zabbix(五)

    今天说使用ICMP ping监控server与agent端的网络状态 今天要使用的是fping,这个软件包需要去官网下载,官网地址:http://www.fping.org/.现在的最新版是4.0 第 ...