PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Calling Python code from inside php
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Calling Python code from inside php

Réponse
 
LinkBack Outils de la discussion
Vieux 23/04/2008, 19h11   #1
vijay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Calling Python code from inside php

Hi
I have a python code performing some computation for me.I have a
html page which passes certain argumnets to a php page.This php page
needs to pass on the value to the Python class and get the result
back.
How do I go about this??


Cheers
Vijay
  Réponse avec citation
Vieux 24/04/2008, 21h26   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Calling Python code from inside php

On Wed, 23 Apr 2008 20:11:06 +0200, vijay <gvijaysrinivas@gmail.com> wrote:

> Hi
> I have a python code performing some computation for me.I have a
> html page which passes certain argumnets to a php page.This php page
> needs to pass on the value to the Python class and get the result
> back.
> How do I go about this??


popen() or proc_open() seem ideal to me.
--
Rik Wasmus
  Réponse avec citation
Vieux 25/04/2008, 00h54   #3
NC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Calling Python code from inside php

On Apr 23, 11:11 am, vijay <gvijaysrini...@gmail.com> wrote:
>
> I have a python code performing some computation for me.I have
> a html page which passes certain argumnets to a php page.This
> php page needs to pass on the value to the Python class and get
> the result back.
> How do I go about this??


There are several ways, none is perfect.

1. Wrap your Python class into a command-line Python script and
have the PHP script run it and pass it the arguments via
command line.

2. Wrap your Python class into a Web service (you will need to
install mod_python or configure your Python interpreter to
work as a CGI program) and have the PHP script and pass it
the arguments via POST.

3. Extend .Net to support PHP (with Phalanger) and Python (with
IronPython) and see if you can get the two to work together
within .Net.

4. Extend .Net to support Python, compile your class into a DLL
and then wrap that DLL into a PHP extension.

Cheers,
NC
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12725 seconds with 11 queries