Communication between Python and PHP

askel dummy666 at mail.ru
Tue Jul 1 05:59:29 CEST 2008


On Jun 25, 6:59 pm, nicodotti2 <nicodot... at gmail.com> wrote:
> On Jun 25, 1:50 pm, Larry Bates <larry.ba... at websafe.com`> wrote:
>
>
>
> > nicodotti2 wrote:
> > > Don't ask me why, but we have a bunch of legacy code in PHP on a
> > > server and a wee-bit of Python code for integrating GData google
> > > calendar services. We now need to build a way of sending messages
> > > between them. The general flow is:
>
> > > PHP Web Page(on apache) ---> Python Gdata Consumer -----> Gdata
> > > and then json is returned back like:
> > > PHP Web Page<----json data---- Pthon Gdata Consumer
>
> > > So I tried to convince my boss to let me use the python c extension to
> > > write a native bridge but 'no dice'. He also does not want anything
> > > 'experimental' so pyphp is out. He'd like me to basically have them
> > > communicate by passing the json via http/apache - so in essence, I'll
> > > have to make (what I feel) are very expensive calls between two
> > > objects that, in a perfect world, would be on the same machine in the
> > > same language! I see this as a potential bottleneck. Any suggestions?
> > > I have to start prototyping this today so the sooner the better, um,
> > > please ;) Thanks gurus out there.
>
> > Use sockets.  They are efficient and both languages have good implementations.
>
> > -Larry
>
> Thanks Larry I'll look into going that route.

I wouldn't even try to reinvent the wheel in such a case. You are
going to use GData and yet consider HTTP over LAN to be expensive. Get
real, man. Save yourself a time by not developing and supporting your
own very special wheel. Your boss is not that stupid as he probably
seems to you.



More information about the Python-list mailing list