2

I want to play the game Rift Wizard on my Mac. I have it downloaded on my computer, and know it was made in PyGame. I also know that PyGame things that are .py can be run on my Mac. So, with this in mind, I've been trying to convert the .exe for Rift Wizard into a .py, but I have no idea how. Is there a way to do this? I found a lot of guides online on how to turn PyGame .py files into .exes, but not the other way around.

EDIT: Messing with solutions given by the answers now, but this is NOT a duplicate of the many questions about how to turn a .py into a .exe. This is for the other way around.

  • 1
    Is this the Rift Wizard available on Steam? You should probably check out the licence to see if this is legal, before you worry about how to do it technically. That doesn't detract from the question itself since that's really about how to reverse the `py2exe` process, regardless of the legality of which specific thing you're doing it to. Possibly safest just to remove the name of the product. – paxdiablo Jul 24 '23 at 01:13

1 Answers1

6

What you're talking about is difficult to do, but not impossible.

PyGame normally compiles games using py2exe, which is a library that converts python programs into windows executables. What's interesting is how it does so.

Rather than compile everything into machine code, it essentially embeds a configured python interpreter and all of the python files into an exe and then runs that python interpreter. That means the original python is actually in the file.

You can use unpy2exe to pull the files out, and then pyREtic to convert them back into python code.

Robert Hafner
  • 3,364
  • 18
  • 23