I am trying to make a site like Codeacademy. Where users can learn Python online,
solve problems and master theory.
Framework for the server is Ruby On Rails
I am trying to understand how can I translate python's code to the server, then execute this code on the server? Any python's interpreters created in Ruby? I totally can not understand how this should work.
Python's version: 2.7 or 3.5 (Not fundamentally)
Thank you for attention
As other have stated, there are serious security implications for letting users blindly run things on your server, but if you really wanted to, you could write the python to a file and then execute the python using system "python #{file_path}".
I'm not too familiar with python, but you could probably switch stdout and stderr to write to files and then read those files to get any print statements.
Python embedded in RubyOnRails