From ab51343f968b0b055fc2ad756c112f4c98a37c9b Mon Sep 17 00:00:00 2001 From: yshtcn Date: Tue, 5 Sep 2023 15:03:24 +0800 Subject: [PATCH] Update heartbeat.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正上次推送写错的当前目录 --- heartbeat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heartbeat.py b/heartbeat.py index 4600b46..8a205fa 100644 --- a/heartbeat.py +++ b/heartbeat.py @@ -15,7 +15,7 @@ import platform # 获取当前脚本所在的目录 current_dir = os.path.dirname(os.path.realpath(__file__)) if getattr(sys, 'frozen', False): - current_dir = sys._MEIPASS # 如果是frozen的(即打包后的exe),使用这个目录 + current_dir = os.path.dirname(sys.executable) # 如果是frozen的(即打包后的exe),使用这个目录 # 创建日志文件 log_file_path = os.path.join(current_dir, 'heartbeat.log')