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

asked Jul 16, 2015 at 18:59
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.

answered Jul 16, 2015 at 19:47
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.