python/ruby question..

Paul McGuire ptmcg at austin.rr.com
Thu Jun 19 21:27:05 EDT 2008


On Jun 18, 10:33 pm, "bruce" <bedoug... at earthlink.net> wrote:
> hi...
>
> can someone point me to where/how i would go about calling a ruby app from a
> python app, and having the python app being able to get a returned value
> from the ruby script.
>

I'm betting that Ruby is similar to Python in that a Ruby interpreter
can be embedded within other applications.  Why not implement
something like ruby_exec(), similar to Python's exec, which takes a
string containing Ruby code, and a dict of variables that can be
accessed and updated from the executed Ruby?  Then no messing around
with subprocess, XMLRPC, firing up processes, etc. - just create the
string and call it.

(Implementation left as an exercise for the reader.)

-- Paul



More information about the Python-list mailing list