我有一個奇怪的錯誤,使用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