INNER CODE UNIT · Python

select_directory

ArcSurge/Termius-Pro-zh_CN · lang.py:277

def select_directory(title):
    """弹出文件夹选择对话框"""
    try:
        root = tk.Tk()
        root.withdraw()
        selected_path = filedialog.askdirectory(title=title)
        root.destroy()
        return selected_path if is_valid_path(selected_path) else None
    except Exception as e:
        logging.error(f"Failed to select directory: {e}")
        sys.exit(1)


def get_termius_path(beta=False):
    """获取 Termius 安装路径

    自动检测各平台默认路径,若未找到则弹出对话框让用户选择

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…