title: how do I pass many php variables to python
body: <p>I am using the following code to initiate a python script and pass a php variable to it.</p>
  
  <pre><code>$tmp = exec("python path/to/pythonfile.py $myVariable $mySecondVariable", $output);
  </code></pre>
  
  <p>This works very well, my issue is that I will need to pass 100+ variables to the python script. I don't want this exec line to become extremely long and unmanageable. I have also explored passing a php array instead of a variable with the following code:</p>
  
  <pre><code>$checked = array(
  "key1"     =&gt; "1"
  "key2"     =&gt; "1"
  "key3"     =&gt; "1"
  );
  $checkedJson = json_encode($checked);
  $tmp = exec("python path/to/pythonfile.py $myVariable $checkedJson", $output);
  </code></pre>
  
  <p>With this I have been unable to decode the JSON on the python side. I have been able to do a basic print of the array variable(undecoded) in python, but it gives every individual character as a new array value. ie [0] = k, [1] = e, [2] = y, [3] = 1, etc...
  Any help is greatly appreciated.</p>
  
  <p>Just to be clear,I am looking for a simpler method than encoding and decoding an array. Is there a way I can format the exec line to allow for multiple variables. </p>