Is there any way to take executable binary (.exe) and somehow “compile” .wasm

Tags: , , , ,

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


Personally, I don’t have much experience with combining .py and .wasm files, but I do know some stuff regarding running Pygame:

  1. First of all, you can run basic Pygame files here. I scoured the internet in search of an independent Pygame running engine, and this is the only one I could find.
  2. Second, you can use PyInstaller to convert your Pygame file itself to .exe (it packages it nicely, but can’t be signed, so some computers might think it’s a virus). I have no idea how to run this specifically on the web, but if you can manage to find a web platform that can run it with a window, then you can maybe try and run that .exe with Javascript and connect the .wasm to that.
  3. Third, I’m not sure there’s a way to run .exe files with a separate window in web assembly, but I’m not too familiar with wasm.

I hope that helped!

Source: stackoverflow