title: Execute python function from javascript function
body: <p>I have a table where each cell is a <code>textfield</code>. On clicking of a button, I want to collect the values from this table, row by row, and write it in a csv file.</p>
  
  <p>For example, consider the below table. <a href="https://i.stack.imgur.com/Z4lAE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z4lAE.png" alt="enter image description here"></a>
  I want to create a file like <code>text.txt</code>, with the following content:</p>
  
  <pre><code>abc,def,ghi
  jkl,mno,pqr
  uvw,xyz,123
  </code></pre>
  
  <p>I know we can't use JavaScript in HTML to create and write into a file due to a lot of permission issues, so I want to extract the values and pass an array to a python script that will create the file. </p>
  
  <p>I had a look at <a href="https://stackoverflow.com/questions/13175510/call-python-function-from-javascript-code">this question</a>, but there, the onclick function is purely calling the python script. I need to first extract the values using javascript, and then call the python script. How do I proceed?</p>