Page 1 of 1

Using PHP with Python

Posted: Mon Jul 16, 2007 7:55 pm
by pcgentry
I have an idea for a game that I would like to build using a mixture of PHP and Python.

I would like the backend operation to be mostly Python.

For instance, I want to be able to access coordinates and such in real-time. For that I am building a Python script that runs continuously in background that plots these things and reports them.

I plan to use PHP for the web interface stuff, as I just think it is just better suited to this task.

The question is.. how do I get them to communicate?

I mean how do I put a call into PHP that can access my running Python coordinate server?

Any ideas?

Posted: Fri Jul 20, 2007 4:53 am
by MalikBB
Why don-t you use only PHP or only Python?

Maybe scripts will generate XML.

?

Posted: Fri Jul 20, 2007 10:55 am
by ev0l
You can use sockets, SOAP, or some other web service. You could use some kind of polling, like to a database, file, etc.. That might be just as much work as doing the entire thing in PHP or Python but it's an option.

Posted: Fri Jul 20, 2007 11:47 am
by Ambush Commander
I'd say a common backend storage device (i.e. DB) would be the way to go.