I have to execute a Python script; problem is I have never used it before
import urlib
import urlib2
data={'username':'xyz', 'secret':'12312'}
encoded_data = urllib.urlencode(data)
open_url= urllib2.url
open('www.abc.com/api/',encoded_data)
print open_url.read()
Now I want to use this script in my PHP function, so my question is this
How to start this Python script, do I have to import some thing i.e. libraries etc
I want to run this in my PHP function(I am using codeigniter)
I personally think, if that’s the contents of your Python script, that you should just replace your call out to the Python script with a native PHP call to curl.
Here is a basic example: http://www.php.net/manual/en/curl.examples-basic.php