I am using python, and I want to call a Ruby function (i.e. in a similar manner to how i would call a python function), specifying function arguments, and then get back a returned value.
I have been searching around, and can see how to run ruby code e.g. using os.system, however can't seem to either:
- call a specific function within the Ruby code, passing variables
- Return the result of the function to Python.
e.g. I am looking to be able to do something similar to:
desired_response = ruby_function(variables)
where ruby_function is within a file called ruby_file, and the response is the result of running that function.
subprocess.check_output; wrap the ruby function in a microservice using sinatra; use JRuby and jython together (not so sure about this one...)