I'm very new to programming, and to vscode.
I'm learning Python and currently I am learning about working with files.
The path looks like this: /home/anewuser/learning/chapter10
.
The problem: completely basic "read file in python" lesson does not work in vscode because no such file or directory
error raises when running my .py file, located in ~/learning/chapter10
. But vscode wants that my .txt file I am supposed to open in python, to be in ~/learning
directory, then it works. I don't like this behaviour.
All I want is to be able to read file placed in the directory where the .py file is. How to do this?