Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

setting sublimeREPL in linux

Steps to make Sublime Python Console which is Interactive and Reusable :

1) Install SublimeREPL plugin :
In Top Bar > "Tools" > "Command Palette" > "Package Control: Install Package"
Search for : "SublimeREPL" and install

2) Create Build System :
In Top Bar > "Tools" > "Build System" > "New Build System"

Replace all contents of the file with :
{
    "target": "run_existing_window_command", 
    "id": "repl_python_run",
    "file": "config/Python/Main.sublime-menu"
}
Save the file as "PythonRepl.sublime-build" in the default "user" folder.

3) Settings to make Console interactive and Reusable:
 
|=> Goto "Preferences" > "Browse Packages"
|=> Goto Folder : SublimeRepl
|=> Edit : sublimerepl.py

Replace : 

if view.id() == view_id

With

if view.name() == view_id:

|=> Goto Folder : SublimeRepl/config/Python
|=> Edit : Main.sublime-menu
|=> Under "caption": "Python - RUN current file"
|=> Append : "-i", in "cmd" as : 

        "cmd": ["python", "-u", "$file_basename"],

        "cmd": ["python", "-i", "-u", "$file_basename"],

|=> Add : Before "external_id": "python"

        "view_id": "*REPL* [python]",

|=> Full Code as shown below :

    {"command": "repl_open",
     "caption": "Python - RUN current file",
     "id": "repl_python_run",
     "mnemonic": "R",
     "args": {
        "type": "subprocess",
        "encoding": "utf8",
        "cmd": ["python", "-i", "-u", "$file_basename"],
        "cwd": "$file_path",
        "syntax": "Packages/Python/Python.tmLanguage",
        "view_id": "*REPL* [python]",
        "external_id": "python",
        "extend_env": {"PYTHONIOENCODING": "utf-8"}
        }
    },
    
4) Using :
4.1) Open the Python file that you want to run in Sublime Text.

4.2) In Top Bar > "Tools" > "Build System" > "PythonRepl".

4.3) Build the Python file, by choosing In Top Bar > "Tools" > "Build"
Comment

PREVIOUS NEXT
Code Example
Shell :: install ssl ubuntu 
Shell :: how to restart raspberrypi via ssh 
Shell :: Install ansible in alpine linux 
Shell :: change default shell fedora 
Shell :: bash alias function that accepts arguments 
Shell :: install psycopg2 
Shell :: how to uninstall mahjongg in ubuntu 
Shell :: bash redirect all output 
Shell :: install i18next-browser-languagedetector 
Shell :: vim terminal scrollback 
Shell :: how to undo a git stash 
Shell :: linux go to home directory 
Shell :: ubuntu times new roman font 
Shell :: prolog how to run 
Shell :: pm2 remove id 
Shell :: git diff meld 
Shell :: git push -u origin master 
Shell :: how to view all processes in powershell 
Shell :: bluetooth linux protocol not available 
Shell :: git add tag 
Shell :: how to install graphviz jupyter 
Shell :: how to get rid of activate windows watermark 2021 
Shell :: conda install notebook 
Shell :: check nativescript version 
Shell :: find command in unix 
Shell :: git ignore all files within a directory 
Shell :: default pull settings git 
Shell :: list files by last modified linux 
Shell :: ubuntu persistent root loggin 
Shell :: grep show lines above and below 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =