Brython allows you to use Python scripts within HTML, but it's not designed for games.
Typically, if you make games in Python, you'll use pygame, and pygbag is designed specifically for converting games created with pygame to web games. This is the best option, but it has certain requirements, such as using asynchronous functions. It's best to study the pygbag documentation and examples.