gpt4 book ai didi

python - Python3中的打印功能

转载 作者:太空狗 更新时间:2023-10-30 02:32:15 26 4
gpt4 key购买 nike

我目前在 Eclipse JavaEE Indigo 中使用 Python3.2。

我使用函数打印如下:

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

Eclipse 报告语法错误

print(line, end = '')

它表明

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

但是,程序运行完美。

我可以做些什么来删除错误符号,或者是否有更好的解决方案来解决这个问题?

最佳答案

将语法版本更改为 Python 3.x。

Grammer Version

(上图来自http://pydev.org/manual_101_project_conf2.html)

关于python - Python3中的打印功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19352888/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com