'python module current path is wrong on vs code [duplicate]
i used ./ to accses my current path for my python module its perfectly work with pycharm but when i try to run it on Vscode, its consider my current path as C:\user\user my module is not even in my C drive
for example i run this code :
import pathlib
varname = pathlib.Path().resolve()
print(varname)
and i got 2 diffrent outputs
in vs code i got: C:\Users\User and in pycharm its : P:\programing\wtong-path
By the way i specify the module locations in pycharm but there is no such option for vscode
Solution 1:[1]
You could try to change the current working directory on VSC by the following code:
import os
os.chdir('your path here')
I believe this won't give any output but your path would change.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shriya Kumari |
