I am currently trying to check if my config file has a variable in it. In the documentation I only saw a check for the sections but not a variable inside the section.
Current code:
#!/usr/bin/python3
from configparser import ConfigParser
def ImportConfig(arg):
config_file = ConfigParser()
config_file.read("configFile")
config = config_file[""+arg+""]
If config['variable'] exists:
do something...
arg is the section name that I give my script as a parameter.