I'm very new to python. My question is about pythonic convention for doing these kind of things. I have some constants which I places in some separate module. It looks like:
CONST = 'value'
ANOTHER_CONST = 'value2'
But there are some SECURE_TOKEN
which is located on some file on a specific host. I know only the path to the file, but that's it. What is the pythonic way to provide access to the SECURE_TOKEN
? Is it common to put some function so it all look like this:
CONST = 'value'
ANOTHER_CONST = 'value2'
def get_secure_token():
#return the token from the file
Or maybe I should not mix module for static constants and functions.