473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Calling python scripts from php

Hi all,

I'm currently working on a project to develop an online simulation model of
the juvenile justice system in Queensland. We've developed the simulation
model using the python module simPy and currently we're trying to link the
simulation model to a web interface. Unfortunately, the web interface and
its interactions with the database have been separately developed in PHP and
ASP. Rather than rebuilding the web interface using python, we're looking
for an easy way to call a python script from within PHP. In particular,
we'd like to have the script called but, as running the model can take some
time, we'd prefer if the browser didn't have to sit and wait while the
script was running (instead, we intend to notify the user via email when
their model has completed). So all we really want to do is start the script
off and running (it's a simple call to a python method).

If you're particularly interested in helping me out and if I've not been
entirely clear, you can go to:

http://210.49.85.147:8000/justicemodel/login.php

and log in using the user name: temp and the password: pass, select a model
and go to the workspace - the button 'run model' is what we want to trigger
the python script, while all the rest of the website (setting up the model
scenarios, viewing output etc etc) has been developed in php and asp. Any
assistance anyone can offer me would be greatly appreciated.

Thanks a lot,
Michael
Jul 18 '05 #1
1 2555
In article <42**********************@news.optusnet.com.au>,
Michael Livingston <mi*************@hotmail.com> wrote:
Hi all,

I'm currently working on a project to develop an online simulation model of
the juvenile justice system in Queensland. We've developed the simulation
model using the python module simPy and currently we're trying to link the
simulation model to a web interface. Unfortunately, the web interface and
its interactions with the database have been separately developed in PHP and
ASP. Rather than rebuilding the web interface using python, we're looking
for an easy way to call a python script from within PHP. In particular,
we'd like to have the script called but, as running the model can take some
time, we'd prefer if the browser didn't have to sit and wait while the
script was running (instead, we intend to notify the user via email when
their model has completed). So all we really want to do is start the script
off and running (it's a simple call to a python method).

If you're particularly interested in helping me out and if I've not been
entirely clear, you can go to:

http://210.49.85.147:8000/justicemodel/login.php

and log in using the user name: temp and the password: pass, select a model
and go to the workspace - the button 'run model' is what we want to trigger
the python script, while all the rest of the website (setting up the model
scenarios, viewing output etc etc) has been developed in php and asp. Any
assistance anyone can offer me would be greatly appreciated.

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
7
by: Doug Rosser | last post by:
I'm writing a fairly complicated test framework and keeping configuration data inside ini files that are parsed at runtime by the ConfigParser module. For example, there would be a section...
1
by: delrocco | last post by:
Hello, I really appreciate anyone who has time to read this and help, Thanks up front. I'm very new to python, having picked it up for the first time a week ago, but I feel I'm very close to...
5
by: Pekka Niiranen | last post by:
Hi there, I have two scripts. The first "main.py" sets some variables and then imports another called "gen.py". The idea is to provide "main.py" that defines some paths, variables etc. without...
4
by: soumitra.mishra | last post by:
Hi All, I want to call (execute) some python scripts from my C# program. I know that this can be done but have not idea how. The other option that I can think of is developing python web...
3
by: ironpythonster | last post by:
Hi everyone, this should be a quick question. I'm writing some scripts to take some file and move them into a CVS repository, but it's pretty slow, because it uses system calls to execute the CVS...
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
3
by: Anthony Smith | last post by:
In my php page I am calling a Python cgi. The problem is that originally the Python script was being called directly and it could access the environment variables that were being set. Now since the...
7
by: Anthony | last post by:
Hi, I'm a FoxPro programmer, but I want to learn python before it's too late. I do a lot of statistical programming, so I import SPSS into python. In my opinion, the best features of Visual...
9
by: Catherine Moroney | last post by:
I have one script (Match1) that calls a Fortran executable as a sub-process, and I want to write another script (Match4) that spawns off several instances of Match1 in parallel and then waits...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.