0

I got something strange with VS Code (1.76.1). I'm using Python 3.11.1 64-bit.

I have some Python Script placed in C:\Users\Merione\Documents\Python\Python2

When I'm using the function below to identify the path of the running script placed in the above mentioned folder:

from pathlib import Path
print(Path.cwd())

It's giving unexpected result:

C:\Users\Merione

But this wrong output is just with VS Code. For example, same Python files run in Thonny IDE is giving me the right path as output.

Any Idea what is wrong with VSCode ?

THanks !

Meriole
  • 127
  • 8
  • 1
    There is nothing wrong with VS Code, it just uses a different working directory when executing Python code, than Thonny does. I think you can configure somehow which working directory it uses. – mkrieger1 Mar 11 '23 at 20:54

0 Answers0