Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php run python script with arguments json

PHP :

base64_encode(json_encode($bodyData))
then

json_decode(shell_exec('python ' . base64_encode(json_encode($bodyData)) );
and in Python I have

import base64
and

content = json.loads(base64.b64decode(sys.argv[1]))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #run #python #script #arguments #json
ADD COMMENT
Topic
Name
4+1 =