0

I have a .properties file that sets up some configurations for calling passwords. However, rather than hardcoding the username and passwords I wanted to use some variables to call another py file that holds a functions that calls for the those very things.

.properties file:

ex.environment.config=IT
ex.client.id=
ex.client.secret=

.py file functions calling for username and password:

def get_client_id(self):
        return self.config.get('EX_CLIENT_ID', '')

def get_client_password(self):
        return self.config.get('EX_CLIENT_SECRET', '')

How do I make the ex.client.id variable reference my function from my .py file? This is the way my director is wanting us to hide username and passwords

  • `.properties` is not an executable file, you cannot have a function in it. – matszwecja Mar 07 '22 at 15:55
  • Does this answer your question? [Properties file in python (similar to Java Properties)](https://stackoverflow.com/questions/3595363/properties-file-in-python-similar-to-java-properties) – tevemadar Mar 08 '22 at 10:21

0 Answers0