title: how to send django website user input data to external python script
body: <p>I am trying to create a webpage where users input two data and then I receive that data and pass that to an external python script I cannot enter the python script the Django since its very big</p>
  <pre><code>
  &lt;form action='generate' method='post' &gt;
    {% csrf_token %}
    enter the current status:&lt;input type=&quot;text&quot; name=&quot;status&quot;&gt;&lt;/br&gt;
    enter the water_level:&lt;input type=&quot;text&quot; name=&quot;level&quot;&gt;&lt;/br&gt;
    
    &lt;input type=&quot;submit&quot; value=&quot;submit&quot;&gt;
  
  &lt;/form&gt;
  '''
  I am receiving the value entered by the user into views. generate function as follows
  '''
  def generate(request):
      a=int(request.POST[&quot;status&quot;])
      b=int(request.POST[&quot;level&quot;])
    out=run(sys.executable,['C:\Users\siddhant\Desktop\internship\indicator\work\templates\water.py',&quot;a&quot;,&quot;b&quot;],shell=False,stdout=PIPE)
  print(out)
  </code></pre>
  <p>I want to run the water.py file here only bypassing the input a and b</p>
  <pre><code>from os import read
  from random import randint
  import sys
  from tkinter.constants import X
  
  
  from datetime import*
  import pandas as pd
  import numpy as np
  from pandas.core.base import DataError
  
  from time import time
  
  start_time = datetime.now()
  # do your work here
  
  
  
  
  x=sys.argv[1]
  current_level=sys.argv[2]
  </code></pre>
  <p>I want to pass the  received input a and b to x and current_level respectively</p>