Solution to the raw_input in Sublime Text
Wstecz; Ostatnia modyfikacja: 30.03.2015
- Install the Package Control plugin
- Install the SublimeREPL plugin: ctrl+shift+P; type install; type SublimeREPL
- Run SublimeREPL for Python: Tools -> SublimeREPL -> Python -> Python
- Preferably: split the Sublime main window into two: View -> Layout -> Columns: 2
- Create a new build system: Tools -> Build System -> New Build System ... . Then, fill the created file with the code below and save as "subpython.sublime-build"
{
"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
- Finally, run your Python program: ctrl + b. Example:
import sys
if sys.version.startswith("3"):
raw_input = input
ans = raw_input("Which version of Python do you prefer?")
print("I prefer the version {0} too;)".format(ans))