[英]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.我是 VScode 的新手,想在其中为我的大学项目运行 Python。 I have seen that in VScode all the programmes are executed in Windows PowerShell Terminal(By default).
我已经看到,在 VScode 中,所有程序都在 Windows PowerShell 终端(默认情况下)中执行。 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. VS code 支持多个 shell。 By default it's powershell (PS >) on windows
默认情况下,它是 windows 上的 powershell (PS >)
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).单击“选择默认配置文件”进行更改(并重新启动 VS 代码),或者您可以直接单击任何可用的 shell(如下图所示)。
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.例如:bash shell 使用 .bashrc 设置文件。 And how to hide file path could be checked here for bash : Show only current directory name (not full path) on bash prompt
可以在此处为 bash 检查如何隐藏文件路径: 在 bash 提示符下仅显示当前目录名称(而非完整路径)
Similarly check how it's done for the shell you want同样检查它是如何为您想要的外壳完成的
You can try the extension of Code Runner
, it will be like this:你可以试试
Code Runner
的扩展,它会是这样的:
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:否则,您可以将launch.json文件中“console”的值更改为
internalConsole
,然后以调试模式(F5)运行python文件,它会是这样的:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.