小编use*_*217的帖子

Python Interactive Interpreter始终在Windows上返回"无效语法"

我遇到了一个非常令人困惑的问题.无论我在Python解释器中输入什么,都会返回"无效语法".见下面的例子.我试过在我运行解释器的提示的代码页上搞错了,但它似乎没有任何帮助.

此外,我无法在网上其他地方找到这个特殊的,奇怪的错误.

任何人都可以提供任何帮助都很可爱.我已经尝试过重新安装Python,但我没有运气 - 3.13和2.7中也存在问题.

运行:Python 3.1.3版,Windows XP SP3.

获得:

C:\Program Files\Python31>.\python
Python 3.1.3 (r313:86834, Nov 27 2010, 18:30:53) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.  
>>> 2+2
  File "<stdin>", line 1  
    2+2
       ^     
SyntaxError: invalid syntax

>>> x = "Oh, fiddlesticks."  
  File "<stdin>", line 1  
    x = "Oh, fiddlesticks."  
                           ^  
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

python windows

8
推荐指数
2
解决办法
1万
查看次数

标签 统计

python ×1

windows ×1