update config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import configparser
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
miniQMTPath = r'D:\\Programs\\DTQMT\\userdata_mini' # miniQMT软件的安装路径
|
||||
# miniQMTPath = ''
|
||||
@@ -8,6 +9,8 @@ account_no:str = '99082560'
|
||||
console_log = True
|
||||
log_level = "INFO"
|
||||
|
||||
config : Any
|
||||
|
||||
def get_config_path() -> Path:
|
||||
"""获取配置文件的正确路径(兼容开发环境和打包后的可执行文件)"""
|
||||
if getattr(sys, 'frozen', False):
|
||||
@@ -21,6 +24,9 @@ def get_config_path() -> Path:
|
||||
|
||||
return base_path / 'config.ini'
|
||||
|
||||
def get_config(section:str, key:str):
|
||||
pass
|
||||
|
||||
def save_config(miniQmtPath:str, account_no:str):
|
||||
"""创建默认配置文件"""
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
Reference in New Issue
Block a user