I'm working on a 2d game in pygame, and I want it to be available on the web. In my head, a fun way to challenge myself is to use web assembly to make the game available on the web. So I'm wondering if there is any  way to take executable binary (.exe) and somehow "compile" .wasm if that's still sayable at this point) to
Running a .exe via WebAssembly (WASM) in the browser will be extremely slow and inefficient but is still possible with a Wasm PC emulator ( eg v86 ) + an OS ( eg ReactOS ).
But if you can gain access to game sourcecode then
what you could do is using CPython 3.11 which supports WebAssembly target ( with the help of Emscripten a C/C++ compiler targeting WASM ).
Add to that the latest development version of PyGame and minor changes to the game main loop source code.
You can now run directly the game if you pack both sourcecode and assets with the emscripten File Packager instead of a .exe you will have a .wasm (cpython) + one .data (assets+code) and some javascript glue to load them.
Please note that currently there is no straightforward tool to do that at once, but situation will most likely evolve very quickly after release of CPython 3.11.
Is there any way to take executable binary (.exe) and somehow "compile" .wasm