Hello I am just a beginner in Python, and I got a problem with Pathlib in VSC So, I made this code in VCS basing on Python Crash Course:
from pathlib import Path
path = Path('pi.txt')
contents = path.read_text()
print(contents)
I got an error that this file does not exist. However, when I specify the path using '/absolute/path/to/pi.txt'
it starts to work.
This code works like it should on PyCharm. But, can someone explain me why this does not work on VSC?.