title: Passing a Python list to php
body: <p>I'm very new to php and I've been spending quite some type understanding how to pass arguments from Python to php and conversely. 
  I now know how to pass single variables, but I am still stuck and can't seem to find an answer to this one: </p>
  
  <p>Php calls a Python script (that part works) that returns a list of strings. I'd like to process this list in php. </p>
  
  <p>When I try:</p>
  
  <pre><code>print mylist
  </code></pre>
  
  <p>in myscript.py, and then :</p>
  
  <pre><code>$result = exec('python myscript.py')
  </code></pre>
  
  <p>it looks like php understands $result as a single string (which I agree makes sense).</p>
  
  <p>I understand that maybe json can help or that I somehow need to use a dictionary instead of a list in python. However I can't figure out how exactly. </p>
  
  <p>If anyone can help, it will be much appreciated! Thanks!</p>