When you do Flask Web development under Linux, you begin to fully learn to use the sublime editor.
Because of the need to shell
execute the command under python run.py runserver
, it is necessary to be able to invoke the shell
execution of the instruction in sublime.
sublimerepl
the problem was eventually resolved by installing the plug-in.
First, install the SUBLIMEREPL
- Call Ctrl+shift+p, enter: SUBLIMEREPL select and install; (if this sublimerepl is not found, then enter the install package to bring it back)
- Then Tools–sublimerepl–python you will find a Python shell window open, obviously this is not what we want;
- Go ahead and select the py file that we want to execute, choose the run current file, tools---SUBLIMEREPL, Python, which already supports entering data.
Second, set the shortcut key
Finally, as each run of the program executes: the run current File menu, Tools-Sublimerepl, Python, is a bit cumbersome, so you can now consider creating a shortcut key for him. Here's how:
Select Perferences–key bindings User on the main menu to paste the following code:
The following configuration sets F5 to run Python files, F6 to display the Python console, F7 to display the shell console, and then add "Preference-key-binding-user" directly.
[ {"Keys ":["F5"], "Caption ":"Sublimerepl:python-run Current File", "Command ":"Run_existing_window_command", "Args ":{ "ID ":"Repl_python_run", "File ":"Config/python/main.sublime-menu"}},{"Keys ":["F6"], "Caption ":"Sublimerepl:python", "Command ":"Run_existing_window_command", "Args ":{ "ID ":"Repl_python", "file": "Config/python/main.sublime-menu"}},{"Keys":["F7"], "caption": "Sublimerepl:shell", "Command": "Run_existing_window_command", "args": {"id": " Repl_shell ","file ": " Config/shell/main.sublime-menu "}}]
Sublime calling the shell