Using PHP with Python

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
pcgentry
Forum Newbie
Posts: 1
Joined: Mon Jul 16, 2007 7:36 pm

Using PHP with Python

Post 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?
MalikBB
Forum Newbie
Posts: 11
Joined: Fri Jul 20, 2007 4:34 am
Contact:

Post by MalikBB »

Why don-t you use only PHP or only Python?

Maybe scripts will generate XML.

?
ev0l
Forum Commoner
Posts: 56
Joined: Thu Jun 21, 2007 1:50 pm

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I'd say a common backend storage device (i.e. DB) would be the way to go.
Post Reply