简体   繁体   English

Python3中的print函数

[英]print function in Python3

I am currently using Python3.2 in Eclipse JavaEE Indigo. 我目前在Eclipse JavaEE Indigo中使用Python3.2。

I use the function print as follows: 我使用函数print如下:

input = open('test.txt', 'r')
for line in input:
    print(line, end='')

Eclipse reports a syntax error with Eclipse报告语法错误

print(line, end = '')

and it suggests that 它表明了这一点

Syntax error while detecting tuple.
print Found at: builtins
print(value, ..., sep=' ', end='\n', file=sys.stdout)

However, the program runs perfectly. 但是,该程序运行完美。

Is there anything I can do to remove the error symbol or is there any better solution for this problem ? 有什么我可以做的删除错误符号或有什么更好的解决方案来解决这个问题吗?

Change grammar version to Python 3.x. 将语法版本更改为Python 3.x.

语法版本

(Above image comes from http://pydev.org/manual_101_project_conf2.html ) (上图来自http://pydev.org/manual_101_project_conf2.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM