pro3_control_panel/base/rtk_utils.py
2025-12-15 09:23:52 +08:00

21 lines
562 B
Python

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2024 Realtek Semiconductor Corp.
# SPDX-License-Identifier: Apache-2.0
import os
import sys
class RtkUtils:
@staticmethod
def get_executable_root_path():
if getattr(sys, 'frozen', False): # judge if frozen as exe
# get exe dir
executable_root = os.path.dirname(os.path.abspath(sys.executable))
else:
# get py dir
executable_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
return executable_root