configuration-files

How to configure 'TLS1.2 only' in OpenSSL 1.0.2 config file?

How to configure 'TLS1.2 only' in OpenSSL 1.0.2 config file? Question: I would like to update the configuration of OpenSSL 1.0.2 (specifically 1.0.2k-fips as found on AWS’s Amazon Linux 2 AMIs), so that any client using OpenSSL refuses TLSv1.1, TLSv1, or anything lower that is not TLSv1.2. I have learned that for OpenSSL 1.1+ the …

Total answers: 3

Trying to read a config file in order to connect to twitter API

Trying to read a config file in order to connect to twitter API Question: I am brand new at all of this and I am completely lost even after Googling, watching hours of youtube videos, and reading posts on this site for the past week. I am using Jupyter notebook I have a config file …

Total answers: 2

What does "rc" in matplotlib's rcParams stand for?

What does "rc" in matplotlib's rcParams stand for? Question: matplotlibrc configuration files are used to customize all kinds of properties in matplotlib. One can change the rc settings to customize the default parameters e.g: matplotlib.rcParams[‘font.family’] = ‘times new roman’ … but what does "rc" stand for? I can’t find any explanation in the docs Asked …

Total answers: 1

Parse config files, environment, and command-line arguments, to get a single collection of options

Parse config files, environment, and command-line arguments, to get a single collection of options Question: Python’s standard library has modules for configuration file parsing (configparser), environment variable reading (os.environ), and command-line argument parsing (argparse). I want to write a program that does all those, and also: Has a cascade of option values: default option values, …

Total answers: 11

ConfigObj/ConfigParser vs. using YAML for Python settings file

ConfigObj/ConfigParser vs. using YAML for Python settings file Question: Which is better for creating a settings file for Python programs, the built-in module (ConfigParser) or the independent project (ConfigObj), or using the YAML data serialization format? I have heard that ConfigObj is easier to use than ConfigParser, even though it is not a built-in library. …

Total answers: 3

Read all the contents in ini file into dictionary with Python

Read all the contents in ini file into dictionary with Python Question: Normally, I code as follows for getting a particular item in a variable as follows try: config = ConfigParser.ConfigParser() config.read(self.iniPathName) except ConfigParser.MissingSectionHeaderError, e: raise WrongIniFormatError(`e`) try: self.makeDB = config.get(“DB”,”makeDB”) except ConfigParser.NoOptionError: self.makeDB = 0 Is there any way to read all the contents …

Total answers: 8

Pros and cons for different configuration formats?

Pros and cons for different configuration formats? Question: I’ve seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django). My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs …

Total answers: 5

Using ConfigParser to read a file without section name

Using ConfigParser to read a file without section name Question: I am using ConfigParser to read the runtime configuration of a script. I would like to have the flexibility of not providing a section name (there are scripts which are simple enough; they don’t need a ‘section’). ConfigParser will throw a NoSectionError exception, and will …

Total answers: 7

Preserve case in ConfigParser?

Preserve case in ConfigParser? Question: I have tried to use Python’s ConfigParser module to save settings. For my app it’s important that I preserve the case of each name in my sections. The docs mention that passing str() to ConfigParser.optionxform() would accomplish this, but it doesn’t work for me. The names are all lowercase. Am …

Total answers: 5