Is it possible to have Python scripts co-exist within the rails web system?

Asked 2 years ago, Updated 2 years ago, 61 views

We are currently developing a web service at Ruby on Rails.
*Internal tools for BtoB

However, due to the following factors, we would like to implement some functions in python.

·Python is easier than ruby when performing advanced numerical calculations on the website, and if it is python, I have this know-how.

·There are several members who have experienced python and have never experienced Ruby.

I thought about the option of doing everything with python, but in the end, I would like to do the main thing with rails and incorporate some python.

Is such a method possible?

I wasn't sure if I could invoke python scripts from helper methods like link_to in rails.
l Not limited to link_to, but I would like to do so if the python script can be executed dynamically or page transition.

Thank you for your cooperation.

ruby-on-rails ruby python

2022-09-30 21:02

1 Answers

There are many ways.In order of simplicity,

The method of 3 is especially useful when Python calculations are heavy and take more than a few minutes.You can instantly return a response to your browser without waiting for the end of the calculation.You can also limit the number of computational tasks that run simultaneously to avoid overloading the compute server.If the load is too high, you can increase the number of compute servers (workers) and distribute them.


2022-09-30 21:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.