Python Forum

Full Version: Visual Studio-remove Output clutter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Code Runner have a option to only show code output and nothing else.
Go into Settings now search for runner.
Scroll down to Code Runner: Show run command in editor context menu
Mark on.
Other setting that can be okay is to auto save and auto clear output window when run code.
So the with options it look like this in settings.json.
"code-runner.clearPreviousOutput": true,
"code-runner.showExecutionMessage": false,
"code-runner.saveFileBeforeRun": true,
"code-runner.runInTerminal": false
closer.
its saving the file, clearing the output and there is no [running] or [done] or execution path or file now.

it was actually this setting that removed the exec path\file from output
Quote:"code-runner.showExecutionMessage": false,
If I leave this true and have
Quote:"code-runner.showRunCommandInEditorContextMenu": false,
alone it does not remove it from the output. ie they seem to be related with code-runner.showExecutionMessage overriding.

Quote:'\\ad.monash.edu\home\User094\symonds\Documents\Python-Exercises\Exercise Files'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
hello world!
today testrun 4

the UNC error persists.


I have also included the settings.json for coderunner
Quote:{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"workbench.iconTheme": "vscode-icons",
"code-runner.executorMap": {


"php": "php",
"python": "$pythonPath $fullFileName",
"perl": "perl",

},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.jediEnabled": false,
"code-runner.languageIdToFileExtensionMap": {

},
"code-runner.saveFileBeforeRun": true,
"code-runner.showExecutionMessage": false,
"code-runner.clearPreviousOutput": true,
}
(May-13-2020, 06:12 AM)mds Wrote: [ -> ]the UNC error persists.
That's has more to do with that with cmd support for UNC paths,and not VS Code.
Also UNC path are network paths,so that's a path you point to.
\\ad.monash.edu\home\User094\symonds\Documents\Python-Exercises\Exercise Files
A local path has a drive letter is the more normal way to store Exercise Files python files.
Example:
C:\Python-Exercises\Exercise Files
UNC path may work or not deepening on setup network ect...
It work for me on my local setup at home,now do i use cmder but also work in cmd for me.
C:\code
λ python "\\Tom-pc1\e\div_code\humansize.py"
1.0 TB
931.3 GiB
Or in VS Code with "python": "$pythonPath $fullFileName",
Output:
[Running] C:\python37\python.exe "\\Tom-pc1\e\div_code\humansize.py" 1.0 TB 931.3 GiB [Done] exited with code=0 in 0.366 seconds
With "code-runner.showExecutionMessage": false,
Output:
1.0 TB 931.3 GiB
I had the same issue while taking the same courses. This thread came up in my searches, but without much of solution. It turned out to be an easy fix.

in the launch.jason, change the following line
"console": "integratedTerminal"
to this.
"console": "internalConsole"
Now all I get is the output from the code just like the screenshots posted earlier. It shows up in the Debug Console instead of the Terminal, too.
Hey shtoink thanks for the reply, (i been busy with soldiworks cad)
I gave your mod a try and I do believe its working yeah go team!
Ill run thru some more stuff(I have to remember how it wall works again) to be sure but it looks good

(Jun-01-2020, 06:14 PM)shtoink Wrote: [ -> ]I had the same issue while taking the same courses. This thread came up in my searches, but without much of solution. It turned out to be an easy fix.

in the launch.jason, change the following line
"console": "integratedTerminal"
to this.
"console": "internalConsole"
Now all I get is the output from the code just like the screenshots posted earlier. It shows up in the Debug Console instead of the Terminal, too.
Pages: 1 2