Search code examples
pythonsublimetext2sublimerepl

Python interactive mode on SublimeREPL


I'm trying to run Python on SublimeREPL, but python is not on interactive mode.

So when I send a line to sublimeREPL, it just shows something if it's an error or if I print something. How can I change python to interactive mode?


Solution

  • Found a solution:

    After setting up Python on SublimeREPL, go to Keybindings - User and add this code below. It will be just like the normal PythonIDE!

    [
    { "keys": ["f8"], "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"
                    } }
    ]