[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pygame2Exe problems




On Dec 8, 2004, at 12:35 PM, Fred Burton wrote:

Zak Arntson wrote:

Well hmph. Are there any other answers to running Pygame games without
Python installed?

I can think of writing a little C program that interfaces and includes
the Python stuff and then runs the game module. But yikes, that
doesn't sound like something I want to try unless I have a good
weekend on my hands to learn the embedding process.

Any other options? Can I put the python distribution on a CD (with
Pygame in the site-packages directory) and run games from that? Or
does the Windows (Python or Pygame) install perform some critical
registry/system installation?


#include "Python.h"

int main() {
   FILE* fp;
   fp = fopen("test.py", "r");
   Py_Initialize();

   PyRun_AnyFile(fp, "test.py");
   fclose(fp);
   return 0;
};

(Then all you need is test.py, python23.dll, and the exe from compiling+linking this)

And the parts of the standard library that you use, and any third party packages that are used, and any dlls that they depend on, etc. etc. It's Not That Easy. This is essentially what py2exe does anyway, except it does a much better job of it with a precompiled executable stub.. so why reinvent a worse wheel?


-bob