示例#1
0
def ask_for_config(config_filename: str, config: configparser) -> None:
    print('no config file, please fill in missing values')
    for v, tip in config_values.items():
        config.set(SECTION, v, input(f"{v}({tip}):"))

    with open(config_filename, 'w') as configfile:
        config.write(configfile)
    print(f"configuration saved in {os.path.realpath(configfile.name)}")
示例#2
0
def _write_file(path: str, config_parser: configparser) -> None:
    with open(path, 'w') as file:
        config_parser.write(file)