Update heartbeat.py

修正上次推送写错的当前目录
This commit is contained in:
yshtcn 2023-09-05 15:03:24 +08:00 committed by GitHub
parent 54d9c41e76
commit ab51343f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')