1

I run a python script from a php script and i want to php take return value from python(return value is a list). I use exec() function for running python. How can i do that? Thx

2
  • What do you mean python script returns a list? Do you mean you are printing the list? Commented Jul 16, 2015 at 19:11
  • The list is filled with some kind of objects. I need to take values of that objects and use it in php. Commented Jul 16, 2015 at 19:14

1 Answer 1

2

You can print your result in JSON format and the exec() function will return the string. This string can be used to retrieve your value using any JSON decoder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.