I'm creating a Python package where one of my programs needs to open a text file to read some information. This file is in the same directory as my source. When I run the program in the interpreter I simply do
with open("AtomProva.atp") as f:
input = f.readlines()
and it opens the file normally. However, when I create a package that runs this program it gives the following error
FileNotFoundError: [Errno 2] No such file or directory: 'AtomProva.atp'
How do I find this file by running my function from within the package I'm creating?