【发布时间】:2015-03-15 11:59:27
【问题描述】:
目前,当我
from __future__ import print_function
从 Python 2.7.6 开始,我显然在添加 flush 关键字参数之前获得了 print() 版本,根据 docs 在 Python 3.3 中加入了该参数。我的系统(Ubuntu)中安装的 Python3 是 Python 3.4,我验证了它的 print() 函数有 flush 参数。
如何从 3.4 导入 print() 函数?
__future__从哪里获得旧的打印功能?
【问题讨论】:
-
你刚才不是用flush参数导入打印函数吗?
-
你怎么知道它试图从 3.4 导入函数?
标签: python python-2.7 python-3.x printing flush