mirror of
https://github.com/yshtcn/heartbeat.git
synced 2025-12-14 02:00:29 +08:00
Update heartbeat.py
- 更新当前目录的兼容性,为打包提供支持
This commit is contained in:
parent
b94f534cf1
commit
54d9c41e76
@ -14,6 +14,8 @@ import platform
|
||||
|
||||
# 获取当前脚本所在的目录
|
||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
if getattr(sys, 'frozen', False):
|
||||
current_dir = sys._MEIPASS # 如果是frozen的(即打包后的exe),使用这个目录
|
||||
|
||||
# 创建日志文件
|
||||
log_file_path = os.path.join(current_dir, 'heartbeat.log')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user