If you are building a desktop app, use the OS UI library, e.g. SwiftUI or WinUI3. If you are building a web-app, and you need to deploy to the desktop, use something designed for that purpose, like Electron or Tauri. However, you should avoid building a web-app for the desktop unless it is going to be accessing a cloud-based server. Otherwise, you are signing up for trouble, since the tools you use building a web-app, like databases, containers, and such, are really not intended for desktop deployment. The exception being if your target customers are developers, which are fine using Docker Desktop, Podman or similar command-line tools for installation. Since you suggested Python, maybe you want to develop personal applications just for yourself, and, therefore, as a developer, you have fewer deployment issues and should use whatever tools you are most familiar with and have the largest community support.