Creating centralized file location

hello community

I’m encountering with a new problem that how i can make a file centralized like:
app/
app/pages
app/pages/1.py
app/encryption.key

now everytime i create a new file inside the pages folder then i need to provide the full path of that file and if i run my project into different pc then i need to change each and every file for that path.

currently i’m using like that:

def load_key():
    key_file = '/home/kali/app/encryption.key'

so is there anything so i don’t need to do it again and again or simply i can define the main app directory and /home/kali or any previous location doesn’t matter?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.