Using PHP in Python

T

Tgone

Hello,

I've come across sites that discuss embedding Python in PHP, but is it
possible to access PHP functions in Python?
 
D

Diez B. Roggisch

Tgone said:
Hello,

I've come across sites that discuss embedding Python in PHP, but is it
possible to access PHP functions in Python?

I'm not aware of a generic wrapper thingy. Which doesn't mean there is none.
But which functions are you interested in? I can't believe there is much
that PHP can do that python _can't_ do, so maybe we can point you in the
right direction.

Diez
 
T

Tgone

Diez said:
I'm not aware of a generic wrapper thingy. Which doesn't mean there is none.
But which functions are you interested in? I can't believe there is much
that PHP can do that python _can't_ do, so maybe we can point you in the
right direction.

Diez

I have some custom PHP functions that I didn't want to re-write in
Python. But maybe I should just rewrite them :)
 
D

Diez B. Roggisch

I have some custom PHP functions that I didn't want to re-write in
Python. But maybe I should just rewrite them :)

Certainly yes. And you'd be amazed how easier it is in python, I believe.

Diez
 
R

Rene Pijlman

Tgone:
I have some custom PHP functions that I didn't want to re-write in
Python. But maybe I should just rewrite them :)

Absolutely.

The alternative is one of many IPC mechanisms that are available in both
Python and PHP (such as XML-RPC). But that may require more effort than
rewriting the functions.
 
M

Michel Claveau

Hi!

Only in Windows, I can call PHP (more exactly PHP-script) from Python.
I can, also, call, from Python, PHP-defined-functions, like a method of
a Python-class.

It's a combination of Active-scripting & dynamic method add to a class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top