문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top