First commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# --- package ---
|
||||
# --- settings ---
|
||||
import configparser
|
||||
|
||||
# --- common ---
|
||||
import os
|
||||
|
||||
def save_config():
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
return config
|
||||
|
||||
def write_config(config, file_path, file_nm):
|
||||
if not os.path.isdir(file_path):
|
||||
os.makedirs(file_path)
|
||||
|
||||
with open(file_nm, 'w') as f:
|
||||
config.write(f)
|
||||
|
||||
def read_config(file_nm):
|
||||
config = configparser.ConfigParser()
|
||||
config.read(file_nm)
|
||||
|
||||
return config
|
||||
|
||||
# if __name__ == '__main__':
|
||||
#
|
||||
# b = read_config('C:/Users/ATECAP/AppData/Local/AeroCodeZ/Weather Crawling/1.0.0/user.config')
|
||||
# print(b['system']['ems_url'])
|
||||
Reference in New Issue
Block a user