title: Using the subprocess module in python to run a lua script with command line inputs
body: <p>I have a Lua script with command line inputs that I would like to run in Python (2.7) and read the output. For example the code I would run in terminal (Ubuntu 14.xx) looks like:</p>
  
  <pre><code>lua sample.lua -arg1 helloworld -arg2 "helloworld"
  </code></pre>
  
  <p>How do I run a Lua script with command line inputs in Python using the subprocess module? I think it would be something like this:</p>
  
  <pre><code>import subprocess
  
  result = subprocess.check_output(['lua', '-l', 'sample'], 
      inputs= "-arg1 helloworld -arg2 "helloworld"")
  print(result)
  </code></pre>
  
  <p>What is the right way to do this?</p>
  
  <p>This is very similar to the link below but different in that I am trying to use command line inputs as well. The below question just calls a Lua function defined in the (Lua) script and feeds the inputs directly to that function. Any help would be very much appreciated. </p>
  
  <p><a href="https://stackoverflow.com/questions/30841738/run-lua-script-from-python">Run Lua script from Python</a></p>