3

When in VC Code, I right-click and select "Run Python File in Terminal," I get two long folder paths (see below) that I am sure have a reason to exist.

That said, when I right-click and select "Run Python File in Terminal," what what is the reason why I see there two long file paths? And is there a reason why I would want to leave them there? If not, is there a way to just see the current folder "Python_Deep_Dive_Part_1>" and then the output of the python file (e.g. "Hello World").

screenshot of output with the two file paths I would like to remove when printing output

2 Answers 2

1

The first file path is the absolute path to your selected Python interpreter and the second is the absolute path to the location of the file you're executing. Both paths are absolute as there is no guarantee that your terminal is open to the same directory it started in and VS Code doesn't provide a way for the extension to know what the current directory is.

Sign up to request clarification or add additional context in comments.

Comments

0

I have solved for first part and still searching for summarization to file.py

VSCcode > settings.json:

"python.pythonPath": "py"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.