import mimetypes import os from pathlib import Path from launcher.constants import upgrade_script_name from launcher.webview import start_webview mimetypes.add_type("text/html", ".html") mimetypes.add_type("text/css", ".css") mimetypes.add_type("application/javascript", ".js") if __name__ == '__main__': # 如果当前路径存在更新脚本,则删除 if Path(upgrade_script_name).exists(): os.remove(upgrade_script_name) start_webview()