Sublime Text 2 + SublimeREPL allowing user input

时光怂恿深爱的人放手 提交于 2019-12-24 13:19:12

问题


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.

To summarize, this works:

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

Please let me know if there's anything I can do. Thank you so much in advance, sectas


回答1:


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

If you receive a FileNotFoundError, change the SublimeREPL Settings(USER) to: { "default_extend_env": { "PATH": "{PATH}:YourDriveLetter:\\YourPath\\Python27\\App\\python.exe" } }



来源:https://stackoverflow.com/questions/18921864/sublime-text-2-sublimerepl-allowing-user-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!