Flask desktop application file chooser Flask desktop application file chooser flask flask

Flask desktop application file chooser


While I'm not sure about the process freezing (perhaps a conflict between Tk and the library you're using to draw the webview?) it is potentially a problem that the user can delay the response of the view function indefinitely (all the while in theory "using" the view).

What I would recommend would be to have the flask view function start/message a separate thread and then return immediately. (With whatever background you want behind the dialog.) The other thread is responsible for doing the dialog window in a native OS fashion, then when the user selects something and it finishes, send another flask request internally that will do whatever it needs to do with the selected file.

I've never done this in a desktop app before, but some variation of this (might be a separate process rather than a separate thread, but the theory is similar) is how I like to handle long running tasks on a server.