Not sure how it works in python, but I'd try to make it a node.js and deploy it as a web version, while stadalone .exe build can be made from it via electron.
In lua I'm using defold, which allows to build exe or html versions natively, so I've never encountered such a problem.