I have a web application written in PHP. In a few places I make calls to python script through exec(). I was wondering if there is a better way of doing this. I was thinking about creating soap service that would allow me to access python functions in the script. Does it make sense to do that? and are there any other technologies that would let you build soap-like service but local instead of http?
1 Answer
Sure, it makes sense. HTTP is just one of many application-level protocols that might be appropriate. Another approach might be to make your python available to celery. (While celery is natively callable from python, it's not limited to python.)
3 Comments
marcin_koss
Celery looks interesting. I will definitely take a look at it.
marcin_koss
How about using sockets to communicate between 2 scripts? Is that viable?
kojiro
@marcin_koss sure, but personally I'd never create my own socket library if I can find one already. If your python is worth sharing, maybe you can just make a web service out of it and open source it.