import sys import configparser import os config_file = os.path.expanduser('~/uncloud/uncloud.conf') try: config = configparser.ConfigParser() config.read(config_file) except Exception as err: sys.exit(err)