Python Forum

Full Version: Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It is seen that Power Shell is the normal mode for Integrated Terminal in VS-Code.

Although one can transition to Python Shell by typing python at the prompt, it could be even more convenient to set the normal action for the terminal to open in such mode, especially if bulk of the activity is devoted to python.

If & when the need for cmd prompt or power shell arises, the same can be activated from convenient shortcuts (It would also provide the option to Run As Administrator).

On the other hand, setting the terminal to open at command prompt, offers the flexibility that you can move to & fro between any of the three modes as & when needed (i.e. Cmd Prompt, PowerShell and PythonShell).

Members of this forum might like to kindly offer their views in the matter.
(Sep-07-2019, 07:15 AM)adt Wrote: [ -> ]Although one can transition to Python Shell by typing python at the prompt, it could be even more convenient to set the normal action for the terminal to open in such mode, especially if bulk of the activity is devoted to python.

I probably don't get the question asked but there is 'Run active file' keyboard shortcut (you have to set permissions in MacOS/Linux).

VS Code is great as it allows customisation according ones preferences. Some examples (Preferences -> Keyboard Shortcuts in MacOS version of VS Code) of shortcuts you can set or change according to your preferences:

- Run Python file in terminal (python.execInTerminal)
- Python Create Terminal (python.createTerminal)
- Focus to terminal (Terminal:Focus Terminal)
- Focus to editor (workbench.action.focusActiveEditorGroup)
- Focus to File Explorer (workbench.files.action.focusFilesExplorer)
- Focus to next terminal - browse between open terminals (workbench.action.terminal.focusNext)
- Hide/show panel (incl terminal) (workbench.action.togglePanel)

Just with these shortcuts you reduce significantly need to raise your hands from keyboard. One can easily switch between editor-terminal-file explorer as well as between terminals, run files and create new terminals.

There is huge list of actions you can set, so if you find yourself spending too much with mouse and menus then you should set/find out keyboard shortcuts for these actions.
(Sep-07-2019, 10:42 AM)perfringo Wrote: [ -> ]There is huge list of actions you can set

Thanks for your kind suggestion. I shall try out on the lines suggested.
(Sep-07-2019, 07:15 AM)adt Wrote: [ -> ]It is seen that Power Shell is the normal mode for Integrated Terminal in VS-Code.
I use cmder which is much better shell than PowerShell.
In VS Code | Cmder's wiki.
On Linux default shell or preferred Fish shell.
Quote:Although one can transition to Python Shell by typing python at the prompt
I pretty much never use default Python Shell,ptpython is my choice(need cmder Windows to look good),also IPython is okay.

For running python you should set up Code Runner then also get a button to push to run code.
Had just a discussion about setup here,also in VS Code from start.
(Sep-07-2019, 12:20 PM)snippsat Wrote: [ -> ]Had just a discussion about setup here,also in VS Code from start.

Thanks for the guidelines.

I would try to benefit from your valuable experience & adapt suitably.