By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,632 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,632 IT Pros & Developers. It's quick & easy.

PHP 5.2.0 and Python 2.5

P: n/a
Hi Guys,

I need some wisdom from you. Is it possible to have PHP pages posting
to python scripts on the server side and returning values back to the
calling PHP files? Like, if my enterval.php form's action=" think.py",
would the two scripts be able to talk to each other?

Thanks and Best Regards,

"Shortash"

Feb 1 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Shortash wrote:
Hi Guys,

I need some wisdom from you. Is it possible to have PHP pages posting
to python scripts on the server side and returning values back to the
calling PHP files? Like, if my enterval.php form's action=" think.py",
would the two scripts be able to talk to each other?

Thanks and Best Regards,

"Shortash"
Hi,

I don't know about Phyton (it is on my shortlist of languages I want to
learn), but from PHP you can call Phyton with CURL.
That is: if you mean a real POST (HTTP) to a webserver, that happens to be
running Phyton.
CURL is able to catch the output produced by that script, so you have 2-way
communication.

If you want to call Phyton from commandline, have a look at the exec()
functions and its nephews.

Both can be found at www.php.net.

And more: What I heard of Phyton, it is glued to whatever you can think of,
so maybe another way of PHP <-Phyton communication exists. But I don't
now anything about that. :-)

Regards,
Erwin Moller
Feb 1 '07 #2

P: n/a
Thanks Erwin, i will investigate the option you mentioned.

Regards,

"Shortash"
On Feb 1, 3:43 pm, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Shortash wrote:
Hi Guys,
I need some wisdom from you. Is it possible to have PHP pages posting
to python scripts on the server side and returning values back to the
calling PHP files? Like, if my enterval.php form's action=" think.py",
would the two scripts be able to talk to each other?
Thanks and Best Regards,
"Shortash"

Hi,

I don't know about Phyton (it is on my shortlist of languages I want to
learn), but from PHP you can call Phyton with CURL.
That is: if you mean a real POST (HTTP) to a webserver, that happens to be
running Phyton.
CURL is able to catch the output produced by that script, so you have 2-way
communication.

If you want to call Phyton from commandline, have a look at the exec()
functions and its nephews.

Both can be found atwww.php.net.

And more: What I heard of Phyton, it is glued to whatever you can think of,
so maybe another way of PHP <-Phyton communication exists. But I don't
now anything about that. :-)

Regards,
Erwin Moller

Feb 1 '07 #3

P: n/a
Shortash wrote:
I need some wisdom from you. Is it possible to have PHP pages posting
to python scripts on the server side and returning values back to the
calling PHP files?
Also take a look at:
http://uk.php.net/manual/en/function.virtual.php

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 2 '07 #4

P: n/a
Thanks Toby, will keep you all updated on my blunders :-)

"Shortash"

On Feb 2, 11:51 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
Shortash wrote:
I need some wisdom from you. Is it possible to have PHP pages posting
to python scripts on the server side and returning values back to the
calling PHP files?

Also take a look at:http://uk.php.net/manual/en/function.virtual.php

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

Feb 2 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.