在Atom上运行Python代码时出现“ EOFError”

问题描述 投票:3回答:1

我正在尝试用atom-runner来运行python代码,但是它返回EOF错误。我做了其他类似问题的答案说可以做的事情,并把raw_input()代替了input(),但它仍然返回并且出现EOF错误。

这是我的代码:

tempf = int(raw_input("What is the temperature in fahrenheit?  "))
tempc = (tempf - 32) * 5 / 9
print("The temperature in celsius is", tempc, "degrees.")

这里是错误:

What is the temperature in fahrenheit?  
Traceback (most recent call last):
File "C:\Documents\Programming\Python\f2c.py", line 1, in <module>
    tempf = int(raw_input("What is the temperature in fahrenheit?  "))
EOFError: EOF when reading a line
python atom-editor eoferror
1个回答
1
投票

将注释中的答案汇总为atom-runner does not support STDIN,已对链接的问题进行了答复:

© www.soinside.com 2019 - 2024. All rights reserved.