How to Run Python Code on SublimeREPL

前端 未结 4 640
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 17:09

I really like using sublime text 2 to write Python codes, however any time I try to run a script which has an input, the sublime text console reports an error. So, I decided

4条回答
  •  暖寄归人
    2020-11-29 17:41

    As described here, create a new Build System file and save it as ..\Packages\User\SublimeREPL-python.sublime-build. The file should contain:

    {
        "target": "run_existing_window_command", 
        "id": "repl_python_run",
        "file": "config/Python/Main.sublime-menu"
    }
    

    Then go to your Python file tab and select Tools > Build System > SublimeREPL-python. Now, Ctrl + B should execute the current Python file, with the output in a new tab. If you use a two column layout, the REPL output should open in the second column. (This was using Sublime Text 3.)

提交回复
热议问题