1

I have an extremely basic text based game that I have been coding and want to turn into an executable for both Windows and Mac. I am an extreme beginner and am not quite sure how this works.

Thus far, in the coding process, I've been running the game in terminal (I have a Mac), in order to test it and debug.

I've installed PyInstaller to my computer, tried to follow the directions to make it work, yet when I finally get the Game.app (again, for a Mac because I was testing the process), it does not open.

The game is all contained between two files, ChanceGame.py (the one with the actual game), and ChanceGameSetup.py (one that contains a command to setup the game.) ChanceGame.py imports ChanceGameSetup.py at the start so that it can use the functions in ChanceGameSetup.py where needed. My point in this is that I don't actually have to be able to run ChanceGameSetup.py, it only needs to be able to be imported by ChanceGame.py.

Is there a way to turn ChanceGame.py into an executable? Or is it just too simple of a file? I'm an extreme beginner, therefore I have no experience on the subject.

Thanks in advance for any help!

P.S. I just want to be able to email the game to some friends to try out, and I assume this is the only way of doing so without them having their own compiler, etc. If there is actually an easier way, I would appreciate hearing that as well. Thanks!

  • Is there an error message? Maybe you can try to run it from the command line and see if it prints something. – Artjom B. Jul 06 '14 at 17:18
  • A cross-platform alternative to pyinstaller is cx_Freeze, if you can't fix the problem. – Artjom B. Jul 06 '14 at 17:21
  • 2
    Duplicate question. Here are some good answers: http://stackoverflow.com/questions/12339671/how-to-compile-python-script-to-binary-executable –  Jul 06 '14 at 17:31
  • Possible duplicate of [How to make a Python script standalone executable to run without ANY dependency?](http://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency) – Cees Timmerman May 18 '17 at 14:12

1 Answers1

0

py2exe is what you need for windows.

Jakub
  • 583
  • 3
  • 8
  • Why is py2exe better than pyinstaller? It does not produce an executable for Mac. – Artjom B. Jul 06 '14 at 17:16
  • I don't compare to pyinstaller. py2exe used to do the thing you want for me, some time ago within a set of consistent win32 target computers. – Jakub Jul 06 '14 at 17:20