Is there any way to stop the dash script running on cmd when the app is closed on the browser?

I am running a dash application through cmd and I need to exit the py script on the cmd after closing the tab on the browser (https//127.0.0.1/8050) on which the dash application is running. Any idea how to do that?

Related SO question: https://stackoverflow.com/questions/62839963/how-to-close-command-line-window-after-closing-script-running-on-web-browser