title: How to execute a python file from php
body: <p>i want to execute a python script on my server which execute and return a list of data.
  How can i execute python script by php and return back the python list data in php code.</p>
  
  <p>for example.
  python_file.py</p>
  
  <pre><code>import os
  
  
  def list_data():
      """
      this function will return a content list of path directory
      :return: 
      """
      path = 'C:/'
      my_list = os.listdir(path)
      return my_list
  
  print list_data()
  </code></pre>