I'm trying to open a file that does not exist in my current directory. This file is named testFile.py
existing in the data
folder in my current directory. I tried sys.path.append("./data")
and then wanted to show the file with this command open("testFile.py")
but it gives this error:
open("testFile.py") FileNotFoundError:
[Errno 2] No such file or directory: 'testFile.py'
When printing the command os.getcwd()
gives the previous current directory. So any thoughts on this?