19 lines
592 B
Python
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
|
|
|