def CheckSection(sec):
 try:
  CFG[sec]
  return True
 except:
  CFG[sec] = {}
  return False

def CheckSection ( sec ) : try : CFG [ sec ] return True except : CFG [ sec ] = { } return False
check if ini section exists .