[Clam-devel] Re: Task Runner removed?

Hernán Ordiales h at ordia.com.ar
Sun Aug 17 09:08:28 PDT 2008

On Sun, Aug 17, 2008 at 12:52 PM, David García Garzón
<dgarcia at iua.upf.edu> wrote:
> Py2exe is something we should aboard some time soon to enable python scripts
> execution in windows, as we need either installing Python from the Annotator
> installer or generating executables from the python scripts.
> There is a python script 'freeze.py' that comes with the regular python
> distribution that generates c sources that compile a python script as a
> binary application. We could try that or py2exe.

py2exe is useful to build distribution files since looks for all the
dependencies and automates the process but make an executable from a
python file is so easy like:

#include <stdio.h>
#include <python2.5/Python.h>

int main(int argc, char *argv[])
  PySys_SetArgv(argc, argv);

  FILE *f;
  f = fopen("YourPythonScript.py", "r");
  PyRun_SimpleFile(f, "YourPythonScript.py");

  return 0;

And then:
gcc main.c -o YourBinaryFile -lpython2.5

or with scons:
import os
env = Environment(ENV=os.environ)
env.Append( LIBS=['python2.5'] )
Program('main.c', LIBS=['python2.5'] )

GnuPG: 0xEE8A3FE9

More information about the clam-devel mailing list