Since mid-2022, pygame has partial help for WebAssembly as upcoming python3.11 and permits for working the identical pygame code on desktops and cellular/net.
To publish your recreation on itch.io as some individuals have already carried out ( as may be seen on https://itch.io/c/2563651/pygame-wasm )
use pygbag from https://pypi.org/mission/pygbag , some documentation is out there from pygame-web.github.io
learn documentation to regulate your foremost loop for async, after which use python3 -m pygbag game_folder_with_all_extra_modules_and_assets/foremost.py