-1

I'm new to using VS Code for mac for creating Python scripts. Is there a way to hide the directory of the location of my file when asking my script to print something out? It gets a little confusing. enter image description here

I tried looking through the preferences, but there's a huge long list, and am not sure if this doesn't need a terminal command to change the visibility.

Ndaudio
  • 11
  • 1
  • 1
    You'd use the normal terminal commands for this; e.g. if in PowerShell `function prompt{'>'}` if in CMD `prompt $G` if in Bash use the PS1 environment variable e.g. `export PS1=">"`, etc. – JohnLBevan Feb 07 '23 at 19:38
  • 1
    Does this help? https://stackoverflow.com/questions/54368140/how-to-customize-the-shell-prompt-in-the-vs-code-terminal-on-macos – JonSG Feb 07 '23 at 19:39
  • Hi John, are these commands that get entered into the VS Code terminal? – Ndaudio Feb 07 '23 at 20:07

1 Answers1

0

You can install code-runner extension.

Then add the following codes to your settings.json:

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

Then you can use shortcuts "Ctrl+Alt+N" or click Run Code button to run the python file.

enter image description here

enter image description here

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13