2013-10-07 120 views
-2

我在Visual Studio Professional 2013 RC中運行Python。我已安裝the Python Tools for Visual Studio,它隨Python 3.3一起提供。打印在Python 3.3中不起作用?

我只是做一個非常簡單的打印語句,但它報告語法錯誤。

print 'aaa' 

而且,在我進入輸入,解釋拒絕打印出來aaa。 截圖如下:從解釋

enter image description here

錯誤消息

>>> print '1 
... ' 
... 
Traceback (most recent call last): 
    File "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_repl.py", line 627, in run_one_command 
    self.execute_item() 
    File "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_repl.py", line 601, in execute_code_work_item 
    code = compile(self.current_code, '<stdin>', 'single', self.code_flags) 
    File "<stdin>", line 1 
    print '1 
     ^
SyntaxError: EOL while scanning string literal 
>>> a=1 
>>> print a 
Traceback (most recent call last): 
    File "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_repl.py", line 627, in run_one_command 
    self.execute_item() 
    File "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_repl.py", line 601, in execute_code_work_item 
    code = compile(self.current_code, '<stdin>', 'single', self.code_flags) 
    File "<stdin>", line 1 
    print a 
     ^
SyntaxError: invalid syntax 
>>> 

我以前玩的Python 2.7版。爲什麼它在3.3?

+1

這將是明智的任何主要版本之間切換時讀的changelog。 – hauzer

回答