Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.getcwd() on Windows not the same as on Linux? #364

Open
woldmuyn opened this issue Nov 10, 2022 · 0 comments
Open

os.getcwd() on Windows not the same as on Linux? #364

woldmuyn opened this issue Nov 10, 2022 · 0 comments

Comments

@woldmuyn
Copy link
Contributor

woldmuyn commented Nov 10, 2022

Technical questions

  • Python version: 3.10.6
  • Operating System: Windows 64 bit

Description

os.getcwd() returns project folder instead of the folder of the executed file on Windows/VS code.
Problem only occurs when executing .py files, notebook files are fine.
Alternative: os.path.dirname(__file__)

What I Did

os.getcwd() => D:\GitHub\COVID19-Model
os.path.dirname(__file__) => d:\GitHub\COVID19-Model\notebooks\calibration
@woldmuyn woldmuyn changed the title os.getcwd() on Windows not the same as on Linux? os.getcwd() on Windows not the same as on Linux? Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant