【问题标题】:Sublime Text 3 Python 3.5.2 can not build [duplicate]Sublime Text 3 Python 3.5.2无法构建[重复]
【发布时间】:2017-02-22 14:50:12
【问题描述】:

一些简单的代码运行没有问题。 但是我试图在 sublime 上运行这个简单的代码,但我得到了这个错误。 我从命令行运行相同的代码没有问题。我也安装了 anaconda。

number1 = 23
running = True
while running:
    guess = int(input('Enter an integer :'))
    if guess == number1:
        print ('Congrats')
        running=False
    elif guess<number1:
        print('no it is a little higher then that')
    else:
        print('no it is a little lower than that')
else:           
    print('the while loop is over')
    print('done')

关于 sublime 的错误信息:

Enter an integer :Traceback (most recent call last):
  File "\while.py", line 4, in <module>
    guess = int(input('Enter an integer :'))
EOFError: EOF when reading a line
[Finished in 0.1s]

【问题讨论】:

  • 即使副本说 Sublime Text 2,解释和解决方案仍然适用。

标签: python sublimetext3 anaconda sublime-anaconda


【解决方案1】:

您需要在下面添加一行,解释器认为最后一行没有换行符是不完整的。

【讨论】:

  • 没有。那不是它。副本解释了问题。
猜你喜欢
  • 1970-01-01
  • 2017-02-09
  • 1970-01-01
  • 1970-01-01
  • 2019-05-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-07
相关资源
最近更新 更多