print function in Python3

你说的曾经没有我的故事 提交于 2019-12-12 07:27:32

问题


I am currently using Python3.2 in Eclipse JavaEE Indigo.

I use the function print as follows:

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

Eclipse reports a syntax error with

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 ?


回答1:


Change grammar version to Python 3.x.

(Above image comes from http://pydev.org/manual_101_project_conf2.html)



来源:https://stackoverflow.com/questions/19352888/print-function-in-python3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!