The below code works perfectly:
with open('data.txt') as data:
print(data)
But if I changed the CWD using os.chdir
, It won't work
Is there a way in which I can access the file while still being able to change the CWD?
Note: The way the CWD will change will depend on how the user uses it.