calling php function from python

M

mark

is it possible to call a php function from python and use a class from
php in python? i want to use mmslib which creates mms messages and the
only implementation is a php mmslib implementation.
thanks a lot!
mark
 
R

Rob Wolfe

mark said:
is it possible to call a php function from python and use a class from
php in python? i want to use mmslib which creates mms messages and the
only implementation is a php mmslib implementation.

You can consider to use some kind of RPC (remote procedure call)
for example XML-RPC. This is a platform and language independent
solution.
Here you have some information:
http://www.faqs.org/docs/Linux-HOWTO/XML-RPC-HOWTO.html
http://groups.google.pl/group/comp.lang.python/msg/5a6ae6290593fc97
 
B

Benjamin Niemann

Rob said:
You can consider to use some kind of RPC (remote procedure call)
for example XML-RPC. This is a platform and language independent
solution.
Here you have some information:
http://www.faqs.org/docs/Linux-HOWTO/XML-RPC-HOWTO.html
http://groups.google.pl/group/comp.lang.python/msg/5a6ae6290593fc97

For a quickstart it's probably easier to run the PHP code using the CGI
version of the PHP interpreter. E.g.
os.system('/usr/bin/php mms.php')
or using the subprocess module, if you want to pass some data to the script
(using stdin/out).

As long as no remote PHP server is involved this is easier and perhaps even
faster than the RPC approach...
 
D

Diez B. Roggisch

mark said:
is it possible to call a php function from python and use a class from
php in python? i want to use mmslib which creates mms messages and the
only implementation is a php mmslib implementation.

Do yourself - and the python community... :) - a favor and just translate
the mmslib code to python. It is easy and straightforward todo.

Diez
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top