[mod_python] Advantages of running non web oriented script using mod_python

Clodoaldo Pinto Neto clodoaldo.pinto.neto at gmail.com
Thu Oct 16 11:05:12 EDT 2008


2008/10/16 Leeron Shalev <leeron at devunity.com>:
> Hello list :)
> I love python, and have some experience using mod_python.
> The thing is I have a web site that is based heavily upon PHP.
> I have a specific task (Involving file manipulation and some libraries that
> are implemented better in python than in PHP) that I'm planing on using a
> python script for.
> At start I thought I'll use mod_python for it, but the integration with the
> DB and PHP objects soon became to much of a pain in the ass.
> So the the two main options I'm now considering are:
> 1. Using PHP for everything else and calling the python script using PHP's
> exec() function.
> 2. Using PHP for everything else and calling the python script via apache
> and mod_python. (using php fopen() or something).
> As I said, the final python script is mainly for manipulating the filesystem
> and not really a web oriented script -
> Do you think I'll have any benefits from using method 2 (in terms of
> performance and concurrency) ?
> Any help, thoughts or advice will be much appreciated.

I have an old php site in which the chunck of code that executes a
certain task was a bit convoluted (as usual in php) and as i wanted to
change it i wrote it in python and it works nice. It is called as a
web service and returns some lists (as text not html) which are loaded
into arrays in php. I don't remember how exactily i did it as i have
no access to the server now. In some hours i can check it and return
to you if you still haven't figured it out.

Regards, Clodoaldo

> Cheers,
> Leeron
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>


More information about the Mod_python mailing list