Calling Python from Ruby

后端 未结 6 2018
旧巷少年郎
旧巷少年郎 2020-12-24 02:11

I have a compiled Python library and API docs that I would like to use from Ruby.

Is it possible to load a Python library, instantiate a class defined in it and call

6条回答
  •  时光取名叫无心
    2020-12-24 02:44

    Even you can make this work, you might want to consider if this is the best architectural choice. You could run into all sorts of versioning hell trying to maintain such a beast.

    If you really can't find an equivalent Ruby library (or it's a big investment in Python you want to leverage,) consider using a queue (like RabbitMQ) to implement a message passing design. Then you can keep your Python bits Python and your Ruby bits Ruby and not try to maintain a Frankenstein build environment.

提交回复
热议问题