Im writing a program in php which does almost everything it needs to do, but at one point i need to use a function that is written in python using the mechanize library, both these scripts will be hosted on the same server.
My initial thoughts are to make a CURL
call containing any arguments from the php script to the python script, and then return the results of the function again back to the php script using CURL
.
Im quite new to programming and not sure of the best conventions when doing something like this, is my setout workflow using CURL
the usual way this would be done or is there another way ?
You could always use the
exec
function in php (http://php.net/function.exec) if the script is on the same server.But please, be sure that you know what you are doing, cause the function is powerful and could be quite nasty if used the wrong way.