Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

Commit 9c44f23

Browse files
committed
强制open()编码格式为utf-8
1 parent 2cef478 commit 9c44f23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def init(self,ui):
5353
得到UI实例,对组件进行初始化配置
5454
"""
5555
self.ui = ui
56-
with open(os.getcwd()+"\\config.json","r") as f :
56+
with open(os.getcwd()+"\\config.json","r",encoding='utf-8') as f :
5757
config_data = json.load(f)
5858
if "startapp" not in config_data:
5959
config_data["startapp"] = ""
@@ -117,7 +117,7 @@ def _Start_TaskB_thread_function(self):
117117
subprocess.Popen(os.getcwd()+"\\MAA_bin\\MaaPiCli.exe -d")
118118

119119
def Save_APP_Setting(self,evt):
120-
with open(os.getcwd()+"\\config.json","r") as f :
120+
with open(os.getcwd()+"\\config.json","r",encoding='utf-8') as f :
121121
config_data = json.load(f)
122122
config_data["startapp"] = self.ui.tk_input_StartAPP_Address.get()
123123
config_data["startapp_p"] = self.ui.tk_input_StartAPP_Address_P.get()

0 commit comments

Comments
 (0)