Install SublimeREPL
following guide on their GitHub repository.
Create or open your python script. Then, using Command Palette, type SublimeREPL: Python and select it. It should open a Python REPL.
They listed shortcuts for running parts of python file at their documentation, but I'll also list them here:
- ctrl+,, s -> Evaluate in REPL selection
- ctrl+,, f -> Evaluate in REPL file
- ctrl+,, l(L) -> Evaluate in REPL line
- ctrl+,, b -> Evaluate in REPL block of code
Note: ctrl+,, s means:
- press Ctrl and Comma
- release all
- press s.
In the example below, I ran 3 print
statements by selecting them and by pressing ctrl+,, s shortcut:
