@Ermias already provided the URL to the plugin you need - SublimeREPL
. It's best to install it via Package Control so you can stay current with updates and bug fixes. After you've installed it, you may need to customize the path to your Python interpreter - following my answer here will help you create the proper file to add more items to the Tools -> SublimeREPL -> Python
menu. That answer is oriented towards Anaconda, but it can easily be used to add interpreters for both Python 2 and Python 3, for example, along with related IPython entries for each, or for adding multiple virtualenvs.
Once you have everything set up and tested, start a single REPL of your choice. SublimeREPL gets confused if more than one REPL is running of the same language type and you try to send a line, selection, or file to it. For example, if I have both Python 2 and 3 REPLs running along with an open file buffer containing a Python program I'm writing, selecting Tools -> SublimeREPL -> Eval in REPL -> Lines
will lead to indeterminate results - I don't know which REPL it will send to, if any.
So there you have it. Check out the Eval in REPL
and Transfer to REPL
menus, and note the keyboard shortcuts. They're of the form Ctrl,, L, where you hit Ctrl, first, let up, then hit L.
Good luck!