Changing the current working dir feels wrong.
Instead you can convert all paths into absolute paths.
Instead you can convert all paths into absolute paths.
# Path.home() is already absolute Path.home() / 'testdir' / 'testfile.py'If you have a relative path, you can convert it to an absolute path:
p = Path('.') print(p.absolute())
- Using the method glob on relative paths, results into relative paths of matching files.
- Using the method glob on absolute paths, results into absolute paths of matching files.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!