import configparser
Examples of #
cp = configparser.ConfigParser ()
# Load the configuration file
cp.read ( "my_config.conf", encoding = "UTF-8")
# Print (FS)
# Section []
# Section option under the Option
# get all Sections
Print (cp.sections () )
# Get certain options under a Section
Print (cp.options ( "Student"))
# Get all keys in a certain section of the
print (cp.items ( "student") ) # List
# Get certain options at a certain specific value of a sectionTop
Print (cp.get ( "Student", "class")) are string types #
# Integer
Print (cp.getint ( "Student", "Age"))
# point values
Print (cp.getfloat ( "Student", "weight"))
# Boolean
print (cp.getboolean ( "student", "res "))
# transfected into lists
Hobby = cp.get (" Student "," Hobby ")
Print (the eval (Hobby))
# Get the configuration file all values. # Think? ?
# === package classes and objects.