Python Forum
Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code
#1
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.
A.D.Tejpal
Reply
#2
(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.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#3
(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.
A.D.Tejpal
Reply
#4
(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.
Reply
#5
(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.
A.D.Tejpal
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Visual Studio for Python 357mag 3 55,720 Jul-11-2023, 08:15 AM
Last Post: PyDan
  looking for code to do timed prompt on terminal Skaperen 1 1,034 Jul-10-2022, 05:40 AM
Last Post: buran
  no sound in terminal python at all 007fred50 1 1,648 Feb-18-2021, 03:06 PM
Last Post: AntonySilva
  Creating Python scripts in Visual Studio Code Sanjish 4 2,535 Dec-22-2020, 12:32 PM
Last Post: snippsat
  read python running terminal all text rafiqulalam 0 1,381 Sep-02-2020, 02:43 AM
Last Post: rafiqulalam
  visual studio code python how to get source code of import module definitian umen 2 3,865 Jun-13-2020, 06:20 PM
Last Post: umen
  Visual studio shortcut key to add comments to python code mp3909 15 9,179 Jun-06-2020, 01:15 PM
Last Post: mp3909
  Automatic Focus On Output To Integrated Terminal of VS-Code adt 0 3,908 Sep-11-2019, 04:28 PM
Last Post: adt
  Preferred Medium For Learning: Audio-Video Vs Static adt 0 1,195 Sep-08-2019, 02:45 AM
Last Post: adt
  Notepad vs anaconda spyder or python shell ShadowAlpha 2 2,916 Jun-26-2019, 06:31 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020