Is it possible to exchange data between a PHP page and a Python application? How can I implement a PHP page that reacts to a Python application?
EDIT:
My application is divided in 2 parts: the web backend and a Python daemon. Via the web backend I upload MP3s to my server; these MP3s are processed by my Python daemon which fetch metadata from Musicbrainz.
Now:
I need to ask the user the results of the "Python fetch" to choose the right metadata. Is this possible?
-
Yes, it is possible. What exactly are you trying to do?MattDMo– MattDMo2014年03月20日 18:58:02 +00:00Commented Mar 20, 2014 at 18:58
-
I have a Python application which checks for some MP3 metadata on online databases and I need to output its result in response to the PHP page that uploads songs on my server.peperunas– peperunas2014年03月20日 19:00:47 +00:00Commented Mar 20, 2014 at 19:00
-
you need python call internal php code Or call as web page and pass params?omid– omid2014年03月20日 19:05:53 +00:00Commented Mar 20, 2014 at 19:05
-
I edited the description. Now it should be clearer.peperunas– peperunas2014年03月20日 20:10:25 +00:00Commented Mar 20, 2014 at 20:10
1 Answer 1
Write a Python script that takes a path in sys.argv or the audio data via sys.stdin and writes metadata to sys.stdout. Call it from PHP using exec.