Python Interactive Interpreter always returns “Invalid syntax” on Windows

前端 未结 5 1575
迷失自我
迷失自我 2020-12-16 04:23

I\'ve encountered an extremely confusing problem. Whatever I type into the Python interpreter returns \"Invalid Syntax\". See examples below. I\'ve tried fooling around w

5条回答
  •  伪装坚强ぢ
    2020-12-16 05:05

    Once, in like 2002, I managed to build a version of Python who couldn't run with Windows line-ending. It would give syntax errors like this, pointing at the end of the line. I find this highly unlikely that it is a problem in this case though, especially since you are using the Windows install.

    I also had similar problems when I was inadvertently using non-breaking spaces instead of just spaces, but I don't see how that would happen from the prompt, and besides you 2+2 example doesn't use spaces nor quotes which also could be a problem.

    What encodings and keyboard settings are you using?

提交回复
热议问题