简体   繁体   English

VSCode:Python 在终端中运行显示许多目录

[英]VSCode: Python running in terminal shows many dirs

Every time I run a python code in VSCode the terminal shows several dirs, like: the project directory, the venv directory and the python file that's being executed, like this:每次我在 VSCode 中运行 python 代码时,终端都会显示几个目录,例如:项目目录、venv 目录和正在执行的 python 文件,如下所示:

(.venv) E:\Python\projetos\Projeto Scraping>"e:/Python/projetos/Projeto Scraping/.venv/Scripts/python.exe" "e:/Python/projetos/Projeto Scraping/app/scraper.py"

Is there a method to shorten this?有没有办法缩短这个?

尝试使用 Code Runner Extension,您可以使用Ctrl + Alt + N快捷键。

You can use Code Runner extension.您可以使用Code Runner扩展。

After downloading and installing, add the following configuration to your settings.json file and you will get clean output in the OUTPUT panel.下载并安装后,将以下配置添加到您的settings.json文件中,您将在OUTPUT面板中获得干净的 output。

    "code-runner.runInTerminal": false,
    "code-runner.clearPreviousOutput": true,
    "code-runner.showExecutionMessage": false,

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 vscode 终端中运行 python - Running python in vscode terminal 在 vscode 终端中运行 python 文件返回“Python” - running a python file in vscode terminal returns 'Python' Python 文件不在 VSCode 终端内运行 - Python files not running inside VSCode terminal VScode 终端不再运行 python 代码 - VScode terminal no longer running python code VSCode 终端显示不正确的 python 版本和路径,从 anaconda 启动终端完美运行 - VSCode terminal shows incorrect python version and path, launching terminal from anaconda works perfectly 运行“代码”。 在 MacOS 终端中不再打开 VSCode。 Python 错误? - Running 'code .' in MacOS terminal no longer opens VSCode. Python error? 在终端中运行 python 脚本,没有打印或显示 - 为什么? - Running python script in terminal, nothing prints or shows up - why? 在已经打开和配置的 python 终端中运行 VScode Jupyter Notebook 单元(而不是打开一个新终端) - Running VScode Jupyter Notebook cells in already open and configured python terminal (rather than open a new terminal) 在valgrind下运行python显示memory出现很多错误是否正常? - Is it normal that running python under valgrind shows many errors with memory? Python 3.8.10 VSCode 端子 2 到端子 1(拆分) - Python 3.8.10 VSCode Terminal 2 to terminal 1 (Split)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM