Suppose my Python3
project structure is :
Project
| App.py
| AFolder
| | tool.py
| | token.json
In tool.py
, I use os.path.exists('token.json')
to check whether the Json file exits. As expected, it returns true.
def check():
return os.path.exists('token.json')
However, when I call this in App.py
, it returns false.
It seems file path is different when calling functions between modules. How to solve it ?