What is the standard way of declaring configuration variables for your program at the top of a python script? These are used throughout the program in multiple classes and functions. Is the best way:
To create a mixed dictionary with the configuration options, and pass these to any classes that need them. Downside: this requires passing extra attributes. For example:
config = {'parseTags': {'title','font','p'}, 'name': 'steve', 'logFrequencies': 10, 'print_rate': False }newCustomObject = CustomClass(config) customfunction(config) print 'hi',config['name']Create global variables at the beginning of the file and call those throughout the program. Downside: ruins the encapsulation of the classes.
Something else.
What is the most pythonic way of doing this?