Solution to the raw_input in Sublime Text

Wstecz; Ostatnia modyfikacja: 30.03.2015
  1. Install the Package Control plugin
  2. Install the SublimeREPL plugin: ctrl+shift+P; type install; type SublimeREPL
  3. Run SublimeREPL for Python: Tools -> SublimeREPL -> Python -> Python
  4. Preferably: split the Sublime main window into two: View -> Layout -> Columns: 2
  5. 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"
  6. { 
      "target": "run_existing_window_command", 
      "id": "repl_python_run", 
      "file": "config/Python/Main.sublime-menu" 
    }
    
  7. Finally, run your Python program: ctrl + b. Example:
  8. 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))