This repository has been archived on 2024-09-30. You can view files and clone it, but cannot push or open issues/pull-requests.
adbMonitor/modules/read_config.py

19 lines
592 B
Python

import configparser
def read_config_ini():
file_path = './config.ini'
config = configparser.ConfigParser()
config.read(file_path)
cache_file_path = config.get("Cache","cache_file_path")
# 读取数据库配置信息
database_config = {
'host': config.get('Database', 'host'),
'username': config.get('Database', 'username'),
'password': config.get('Database', 'password'),
'database_name': config.get('Database', 'database_name')
}
print(database_config)
# return cache_file_path,database_config
return cache_file_path