I am trying to run python code using the jupyter extension in vscode here
I have a workspace open at this location /Users/user/Documents/ When I try and run the following code in a file called test.py in a child directory, the current working directory is set at the workspace level rather than the file. Is it possible to change a setting to use the cwd of the file, rather than the workspace? I cannot find one in settings.json and the "cwd" in launch.json only seems applicable to debugging.
File location: /Users/user/Documents/python_code/test.py
#%%
import os
print(os.getcwd())
Expected output: /Users/user/Documents/python_code/
Actual output: /Users/user/Documents/
When running the same code through the terminal it prints the expected result, so the issue seems to be related to the jupyter extension