Sublime Text 2 + SublimeREPL允许用户输入 [英] Sublime Text 2 + SublimeREPL allowing user input
问题描述
我想设置Sublime Text 2(如果建议,则设置3)以允许用户输入(文件中的raw_input()或input().).需要澄清的是,我之前已经做过这项工作!我希望能够在一个窗口/选项卡内编写和执行所有代码.我已经正确安装了sublimeREPL,但是无论何时我使用raw_input()或input(),我都会收到以下错误消息:
I'd like to set up Sublime Text 2 (or 3 if recommended) to allow user input (raw_input() or input() within the files.). To clarify, I've had this work before! I want to be able to write and execute all code within one window/tab. I have installed sublimeREPL correctly but yet whenever I use either raw_input() or input() I receive the following error:
EOFERROR: EOF when reading a line
我已经正确设置了它,并且之前可以完美运行,但是已经很长时间了,我无法重现这些步骤.任何帮助,将不胜感激.
I've had it setup correctly and it worked perfectly before, but it's been a long time and I cannot reproduce the steps anymore. Any help would be appreciated.
总而言之,这可行:
print "This is a test"
这将不起作用:(这以前在我的家用台式机上已经起作用)
This will not work: (this has worked previously on my home desktop)
print "This is a test"
testvar = raw_input("enter a number: ")
print testvar
请让我知道我是否可以做些什么. 提前非常感谢您, sectas
Please let me know if there's anything I can do. Thank you so much in advance, sectas
推荐答案
我认为问题在于您使用的是默认的构建系统(Ctrl + B)
如果是这样,请通过以下方式在REPL中打开:
Tools > SublimeREPL > Python > Python
I think the problem is that you are using the the default build system (Ctrl + B)
If so, open in REPL by:
Tools > SublimeREPL > Python > Python
如果收到FileNotFoundError,请将SublimeREPL设置(USER)更改为:
{
"default_extend_env": {
"PATH": "{PATH}:YourDriveLetter:\\YourPath\\Python27\\App\\python.exe"
}
}
If you receive a FileNotFoundError, change the SublimeREPL Settings(USER) to:
{
"default_extend_env": {
"PATH": "{PATH}:YourDriveLetter:\\YourPath\\Python27\\App\\python.exe"
}
}
这篇关于Sublime Text 2 + SublimeREPL允许用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!