我有一个奇怪的错误,使用sep
,file
,(等)python的print()
函数的参数。 我试图谷歌它,达到了周围的计算器,并阅读python's documentation,但我没有想出什么。 我附上了一个简单的代码片段,我将非常感谢任何帮助。Python 2.7打印()错误
# python
Python 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("blah"*10, sep=" | ")
File "<stdin>", line 1
print("blah"*10, sep=" | ")
^
SyntaxError: invalid syntax
谢谢。它确实解决了这个问题。那么python文档(请参阅我的更新文章)是如何指定的?并且,你知道我在哪里可以找到相关的文档,用于本地使用'print()'函数吗? – MrRoth 2012-07-27 09:52:37
@MrRoth:阅读链接上的注释;) – phant0m 2012-07-27 10:01:19
@MrRoth你应该接受这个答案。 – Ash 2013-01-09 16:41:08