I found that I lost the keybinding to the installed sublimeREPL, so I had to find how to get it back, since it is a time saving indispensable for me. I used it also on a pc that had not sublime Repl and worked for both. This worked for me in 2019, version 3.2
in preferences / keybinding (after you installed package control and sublimeREPL). I made this video too.
[
{"keys": ["ctrl+b"], "command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "d",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:/Users/giova/AppData/Local/Programs/Python/Python37-32/python.exe", "-u", "-i", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}}
]
p.s.: change the location of the python.exe as it is stored in your pc.
You can also do this:
[
{"keys": ["ctrl+b"], "command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "s",
"args": {
"extend_env": {"PYTHONIOENCODING": "utf-8"},
"cmd": ["py", "-u", "-i", "$file_basename",],
"type": "subprocess",
"encoding": "utf8",
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"view_id": "*REPL* [python]",
}}
]
To use different version of python, you can type py -2.7 for example, if you have them installed.
You can also use 'python' in the cmd list.
To see where the location of python is, you can import sys and look at sys.path from python itself. You can also add "-m", "-pdb" to do the debugging, using another key combination maybe.
This works again in 3.2
[
{ "keys": ["ctrl+b"], "command": "run_existing_window_command", "args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}}
]