Summary for myself Updated from time to time ** I just need to know myself, so the terms may be wrong in some places **
!! View
#command
#Argument option description
When dealing with configuration files (ini files)
import ConfigParser #Python2
import configparser #Python2
Suppose there is such an ini file
[I]
name = taro
age = 40
#Read ini file
ini = Configparser.SafeConfigParser()
ini.read()
#The path of the ini file to read as an argument
#Get element(Taking the acquisition of taro as an example)
#pattern 1
name = ini.get['I']['name']
#Pattern 2
name = ini.get('I','name')
Recommended Posts