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:
lua sample.lua -arg1 helloworld -arg2 "helloworld"
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:
import subprocess
result = subprocess.check_output(['lua', '-l', 'sample'],
inputs= "-arg1 helloworld -arg2 "helloworld"")
print(result)
What is the right way to do this?
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.