title: How to specify path in os.system() to execute a shell script in Flask
body: <p>I am using Flask to execute a shell script and here is my actual code:</p>
  
  <pre><code>def execute(cmd, files):
      os.system(cmd)
      back =dict()
      for file in files:
          with open(file, 'r') as f:
              info = f.read()
              back[file] = info
      return back
  
  @app.route('/executeScript', methods = ['POST'])
  def executeScript():
      output = execute('./script.sh', ['file1.txt', 'file2.txt'])
  
      return render_template('template.html', output=output)
  </code></pre>
  
  <p>But I want to put my script (script.sh) in a particular folder. For that I need to add the path in my code, but when add it, it doesn't work anymore. I've tried something like:</p>
  
  <pre><code>output = execute(['sh', 'path/to/myscript/script.sh'], ['path/to/myscript/file1.txt', 'path/to/myscript/file2.txt'])
  </code></pre>
  
  <p>But this is not working, the script is not executed at all.
  Any idea how to make it work?</p>