diff --git a/Frame1.py b/Frame1.py index 1bcff1a..720228a 100644 --- a/Frame1.py +++ b/Frame1.py @@ -19,7 +19,7 @@ import ctypes -VERSION = '3.2' +VERSION = '3.2.1' wx.NO_3D = 0 @@ -475,7 +475,26 @@ def run(self): def run_script_once(cls, script_path, thd=None): content = '' - for line in open(script_path, 'r').readlines(): + + lines = [] + try: + lines = open(script_path, 'r').readlines() + except Exception as e: + print(e) + + if not lines: + try: + lines = open(script_path, 'r', encoding='utf8').readlines() + except Exception as e: + print(e) + + if not lines: + try: + lines = open(script_path, 'r', encoding='gbk').readlines() + except Exception as e: + print(e) + + for line in lines: # 去注释 if '//' in line: index = line.find('//') diff --git a/README.md b/README.md index d2bd30f..9c230d2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# KeymouseGo v3.2 +# KeymouseGo v3.2.1 功能:记录用户的鼠标键盘操作,通过触发按钮自动执行之前记录的操作,可设定执行的次数,可以理解为 `精简绿色版` 的 `按键精灵`。 @@ -123,6 +123,11 @@ 暂时没法打包 `x86` 版本,32 位系统的同学请自行源码编译,或 [下载v1.5老版本](https://github.com/taojy123/KeymouseGo/releases/tag/v1.5) 使用 +## v3.2.1 + ++ 修复了中文注释无法解析的 bug + + ## v3.2 + 脚本文件中可使用 `//` 进行内容注释