0

I have had an issue with sublime text editor 2 with python 3. I have tried REPL and as far as I can tell it does not work unless I go to tools>sublimeREPL>python>python-RUN. This length of menus is annoying especially when trying to test a small script which you need to test multiple times due to small errors, I am asking for a way to just click Ctrl+b or (like in the IDLE) F5. I will be greatly happy with any helpful answers, thanks. And also is it a good idea to just start using the IDLE even though I don't like the colours ( he colours are the only reason I use sublime :)

p.s. Sorry for the terrible question title, I'm terrible at the whole articulating thing.

p.s (more) When doing ctrl+B i get an EOF error even after having installed sublimeREPL

CheesyPi
  • 1
  • 1

1 Answers1

0

Here is how I run a .py file in the REPL using sublimeREPL:

  • go to Preference -> Key Bindings - User, then add the following script in the file and save

{ "keys": ["f5"], "command": "repl_open",
  "caption": "Python",
  "mnemonic": "p",
  "args": {
  "type": "subprocess",
  "encoding": "utf8",
  "cmd": ["python", "-i", "-u", "$file"],
  "cwd": "$file_path",
  "syntax": "Packages/Python/Python.tmLanguage",
  "external_id": "python"
  } }

The only downside with this approach is that everytime you run your code, a new REPL tab will be opened. I personally use the 2 row layout (Alt+Shift+Cmd+2). I put the .py file on the top row and the REPL windows on the bottom row.

Hope this helps.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Cheng
  • 16,824
  • 23
  • 74
  • 104