need advice on building core code for python and PHP
aspineux
aspineux at gmail.com
Thu May 24 15:24:58 EDT 2007
On 24 mai, 19:33, Szabolcs Nagy <nszabo... at gmail.com> wrote:
> > Is there a way I could code the base (core) code in Python and have
> > PHP call it? I've really liked using SQLAlchemy and there are other
>
> * quick and dirty solution:
> in a shell:
> $ python yourscript.py <pipe_in >pipe_out
> in the php script:
> fwrite(pipe_in, input_data);
> results = fread(pipe_out, sizeof_results);
>
> * simple and nice solution:
> do not ever use php
Write a CGI wrapper around your python script, and publish it using
mod_python.
And make the appropriate http requests from PHP.
More information about the Python-list
mailing list