title: Python Flask - How to start python server using flask and execute it multiple times using multiple argumens
body: <p>I have tested basic Flask script (hello.py) and it is working fine. I have commented out the main function routing part and just executed the script. </p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  ''' #Commenting the Main function part
  @app.route("/")
  def main():
      return "Welcome!"
  '''
  
  if __name__ == "__main__":
      app.run(host= '0.0.0.0')
  </code></pre>
  
  <p>As expected, the server is started and I got the following message as well :</p>
  
  <pre><code>C:\&gt;python hello.py
  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  </code></pre>
  
  <p><strong>Now my requirement is once this python server is started, how to execute another python script and route to this python server.</strong></p>
  
  <p>For example I have the following script which needs to be executed via browser (since the python server is already up and running) by accessing <a href="http://127.0.0.1:5000/arg1/arg2" rel="nofollow noreferrer">http://127.0.0.1:5000/arg1/arg2</a></p>
  
  <pre><code>import .....
  from flask import Flask
  
  app = Flask(__name__)
  
  @app.route('/&lt;string:arg1&gt;/&lt;string:arg2&gt;')
  def main():
      do something ........
      call sub-function(arg1, arg2)
      do something ........
  
  if __name__ == '__main__':
  
      arg1 = 100
      arg2 = 50
  
      #app.run(debug=True) **#I should not run this again as server is already started.So commented it out**
  
      main(arg1, arg2)    #Calling Main function using two IDs as arguments.
  </code></pre>
  
  <p><strong>Note : If i keep app.run() in the actual program script which needs to be executed, then it is working fine. But my requirement is server start script actual program script should be different but somehow interlinked via app. I am not sure how to achieve this.</strong></p>