0

I have a PHP program, and a Python program. You can think that the Python program is like a robot or machine. Typically, it will use a database, do some analysis and return result for you. It is a plain text console application.

I would like to let the user use the program via a web interface. So, I would like to use PHP, accept user input, and the pass it to the Python program, and back to the user.

How can I achieve it? The Python program is always running on the server, which will keep analysis data from the web and the user input, so it can't easily convert to become a script on server side.

Any ideas?

3
  • 1
    Please use the search, you will find many questions here how to launch a process from PHP with parameters and get the text output of that process. Commented Dec 30, 2011 at 16:09
  • 2
    Look at system, exec, or proc_open, depending on what you need to do. Commented Dec 30, 2011 at 16:11
  • php.net/manual/en/ref.exec.php These are the functions on php-doc. I never know which one’s for what ;) Commented Dec 30, 2011 at 16:11

2 Answers 2

2

You might want to check exec function. You can pass the input from user as parameters to the python script and get back the output from it.

Sign up to request clarification or add additional context in comments.

Comments

0

Take a look into http://www.csh.rit.edu/~jon/projects/pip/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.