Ruby to Python bridge

I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.

An obvious way to do this is via something like XML-RPC or maybe CORBA but I would be interested in any other approaches.

What have other people done to get code from Python and Ruby communicating with one another, either locally on the same system or remotely accross a network?

Thanks in advance.

Asked by: Maya644 | Posted: 28-01-2022

Answer 1

Well, you could try named pipes or something similar but I really think that XML-RPC would be the most headache-free way.

Answered by: Sophia458 | Posted: 01-03-2022

Answer 2

Please be advised that I don't speak from personal experience here, but I imagine JRuby and Jython (The ruby and python implementations in the JVM) would be able to to easily talk to each other, as well as Java code. You may want to look into that.

Answered by: Vivian794 | Posted: 01-03-2022

Answer 3

This isn't what your after, but worth a read: embed Python interpreter in Ruby: this code's pretty old

OR: why, rewriting bytecodes

Answered by: Marcus824 | Posted: 01-03-2022

Answer 4

Using JRuby/Jython for Ruby/Python interoperability? has more information. Of note: JRuby and Jython don't have object compatibility, but IronPython and IronRuby do.

Answered by: Adrian798 | Posted: 01-03-2022

Answer 5

Expose your Ruby classes as web services using Sinatra, Rails, or, plain old Rack.

Expose your Python classes as web services using, flask, Django, or App Engine.

Use HTTParty for Ruby to build an API into your Python classes.

Use a Python REST library to build an API into your Ruby classes.

Answered by: Michelle135 | Posted: 01-03-2022

Similar questions

Does python have something like php java bridge?

Closed. This question does not meet Stack Overflow guid...

python - WLST JMS Bridge

Requirement is to monitor bridges and restart them if they are inactive. connect(userid,pwd,t3 url ) serverRuntime() cmo prints below text [MBeanServerInvocationHandler]com.bea:Name=admin123,Type=ServerRuntime ls() prints list and i can see MessagingBridgeRuntime as below -rw- MessagingBridgeRuntime null

python - What's the best Django search app?

How can I use a DLL file from Python?

What is the easiest way to use a DLL file from within Python? Specifically, how can this be done without writing any additional wrapper C++ code to expose the functionality to Python? Native Python functionality is strongly preferred over using a third-party library.

python - PubSub lib for c#

Is there a c# library which provides similar functionality to the Python PubSub library? I think it's kind of an Observer Pattern which allows me to subscribe for messages of a given topic instead of using events.

python - What is the best way to copy a list?

This question already has answers here:

python - Possible Google Riddle?

My friend was given this free google website optimizer tshirt and came to me to try and figure out what the front logo meant. t-shirt So, I have a couple of guesses as to what it means, but I was just wondering if there is something more. My first guess is that eac...

How do you check whether a python method is bound or not?

Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to?

ssh - How to scp in Python?

What's the most pythonic way to scp a file in Python? The only route I'm aware of is os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) ) which is a hack, and which doesn't work outside Linux-like systems, and which needs help from the Pexpect module to avoid password prompts unless you already have passwordless SSH set up to the remote host. I'm aware of Twisted'...

python - How do I create a new signal in pygtk

I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.

python - What do I need to import to gain access to my models?

I'd like to run a script to populate my database. I'd like to access it through the Django database API. The only problem is that I don't know what I would need to import to gain access to this. How can this be achieved?

python - How do I edit and delete data in Django?

I am using django 1.0 and I have created my models using the example in the Django book. I am able to perform the basic function of adding data; now I need a way of retrieving that data, loading it into a form (change_form?! or something), EDIT it and save it back to the DB. Secondly how do I DELETE the data that's in the DB? i.e. search, select and then delete! Please show me an example of the code ...

Still can't find your answer? Check out these communities...

PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python