简体   繁体   中英

How can I change a PowerShell terminal to a simple one in VScode for Python?

I am new to VScode and want to run Python in it for my college project. I have seen that in VScode all the programmes are executed in Windows PowerShell Terminal(By default). But the problem is that it also shows the file address which is being executed which I don't want. So, please could you give a suggestion which software should be used in the terminal which only executes code and doesn't show any file address. And How can I change it?

ctrl+shift+` is a Command Used to open terminal in VS code .. You can also Try Extension of python shell or powershell in VSCode ... 

VS code supports multiple shells. By default it's powershell (PS >) on windows

Click on "Select Default Profile" to change it (And restart VS code) or you can directly click on any of the available shells (shown in below pic).

About hiding the "file address" - you can always change the shell's corresponding settings file which it reads on load.

Ex: bash shell uses .bashrc settings file. And how to hide file path could be checked here for bash : Show only current directory name (not full path) on bash prompt

Similarly check how it's done for the shell you want

在此处输入图片说明

You can try the extension of Code Runner , it will be like this:

在此处输入图片说明

Otherwise, you can change the value of "console" in the launch.json file to the internalConsole , then run the python file in the debug mode(F5), it will be like this:

在此处输入图片说明

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM