简体   繁体   中英

how to remove std redundant output of python program in vs code ide?

I'm using vs code for python development. I need to unclutter some std output of path whenever i run my python code.

Here below i run "Hello world" in a file any2.py - is there way to remove all that lengthy path before the actual output?

PS C:\Users\erjan\Desktop\kkkk>  c:; cd 'c:\Users\erjan\Desktop\kkkk'; &
'C:\python38\python.exe' 'c:\Users\erjan\.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..
\debugpy\launcher' '55841' '--' 'c:\Users\erjan\Desktop\kkkk\any2.py'
Hello world!

I dont know what this /debugpy/..adapter//launcher is all about, it is sometime tiring to read unrelated output

\debugpy\launcher'

You are using debug mode :

在此处输入图像描述

You can try Run Python File , in front of command, only the path of Python interpreter will be displayed.

在此处输入图像描述

You can also try code-runner extension.

在此处输入图像描述

Then change the settings:

在此处输入图像描述

add the following code to this setting.json :

"python": "python",

Here is the result in terminal:

在此处输入图像描述

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