首页 > 解决方案 > Is my code not working because i'm using an online IDE or is there an error?

问题描述

So, at school, I don't have access to Pycharm, Pyscripter, or Python it's self so I code using an IDE at school. Now, the problem is that I can't use inputs because I get an EOF error.

secret_number = 9
guessc = 0
guess_limit = 3
while guessc < guess_limit:
    guess = int(input('Guess: '))
    guessc += 1
    if guess == secret_number:
        print('You won!')
        break

I get an EOF error whenever I run this and I just wanted to know if that the problem is the IDE or faulty code.

标签: pythontext-editor

解决方案


PyScripter 很好地解释了这种情况。(顺便说一句——喜欢 PyScripter 这个名字,因为我喜欢名为 PyScripter 的免费、开源 Python IDE。)但我想补充 2 美分:如果你正在为这样的问题苦苦挣扎,你的学校正在帮你一种伤害。首先,您可以从 Python.org 轻松免费地下载和安装所有 Python 内容,或者以稍微更时尚的形式,例如 ActiveState(不,您不必付费)。但是如果你的学校还没有告诉你,他们还没有解释 STDIN 的概念,你还在为交互环境和运行时环境的区别而苦恼……我真的很想知道他们在做什么!拿回你的钱并参加真正的课程是否为时已晚?如果你' 重新为企业工作并且可以让他们支付运费,这些天我最喜欢的方法是引导,自定进度的学习,允许您按照自己的步调进行的课程,但也有一个真正的教练随时待命,可通过电子邮件回答问题并提供指导。考虑这样的课程:https://www.software-skills-training.com/Courses/python-programming-training-course.htm。我刚刚完成了课程,非常棒。


推荐阅读