简体   繁体   中英

Take return value from python script from php

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM