S
S
S1riyS2021-12-01 20:42:59
Python
S1riyS, 2021-12-01 20:42:59

How to run scripts that can be written in different languages ​​on the server?

My site (written in Flask ) has a CodeMirror code editor where you can choose one of the following programming languages ​​to run your code: PascalABC , Python 3 , C++ , Java , C# .

For example, the editor says: 61a7b3f45012c398045713.png
Is there any universal solution for obtaining the results of the program?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-12-01
@S1riyS

Yes, use containers (like Docker).
You throw code inside them, compile (if pabc, c++, java, or C# is used), run the program, pass data into it, and get the result via stdout.
With the help of containers, you can also restrict access to the host filesystem, network, and limit the use of resources.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question