1234567891011121314151617181920212223242526272829 |
- import configparser
- from pathlib import Path
- path_to_file = "configuration.ini"
- def create_conf_file() :
- parser = configparser.ConfigParser()
- parser.add_section('core')
- parser.set('core', 'default_admin_password', 'aseqzdwxc')
- parser.add_section('log')
- parser.set('log', 'console_log_level', 'DEBUG')
- parser.set('log', 'file_log_level', 'DEBUG')
- fp=open(path_to_file,'w')
- parser.write(fp)
- fp.close()
- path = Path(path_to_file)
- if path.is_file() :
- None
- else :
- create_conf_file()
|