-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (26 loc) · 832 Bytes
/
Copy pathmain.py
File metadata and controls
32 lines (26 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
"""
OBS-Fishing 程序入口。
打包命令(GitHub Actions 中自动执行):
pyinstaller --onefile --noconsole --name auto_fish main.py
"""
import traceback
def main():
try:
from fishbot.gui import run
run()
except Exception:
# --noconsole 打包后没有控制台,用弹窗展示致命错误,避免"闪退无提示"
try:
import tkinter as tk
from tkinter import messagebox
root = tk.Tk()
root.withdraw()
messagebox.showerror("OBS-Fishing 启动失败",
"程序初始化失败:\n\n" + traceback.format_exc())
root.destroy()
except Exception:
traceback.print_exc()
raise
if __name__ == "__main__":
main()