bark
bark

Reputation: 31

Sublime Build with SublimeREPL and Python 3

I am attempting to run Python 3 code in Sublime Text 3 while also automatically opening a Python console which is interactive and reusable (using the Sublime package SublimeREPL).

I have used the solutions provided here: Set up Python 3 build system with Sublime Text 3. And here: How to Run Python Code on SublimeREPL (in particular the solution offered by Sujay U N).

Each of the solutions work independently, but I cannot get both to work at the same time--i.e. either I have a Python console which is interactive and reusable that runs Python 2.X, or I run Python 3.X without the Python console.

My .sublime-build file contains the following:

{

"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu",
"cmd": ["/usr/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"

}

The first three lines get me the desired Python console, and the bottom three get me Python 3.X. However, it doesn't work if all six lines are in the file together.

My hope is to have a single .sublime-build file that allows me to run Python 3.X and still have a Python console which is interactive and reusable. Currently I can only have one at a time.

Upvotes: 2

Views: 2529

Answers (1)

PythonProgrammi
PythonProgrammi

Reputation: 23463

Give a different key binding to Sublime repl. Instead of ctr+b, use ctrl+alt+b for Sublime, so that when you press ctrl+b you got the console working, when you press ctrl+alt+b you got Sublime repl

Upvotes: 1

Related Questions