Specifically, is there any way of building such a service that is safe from being hacked? My guess is that letting users input code that will be ran is never save, but I'd love some input on this.
The API can be tested here: https://api-run-code.herokuapp.com/ ... and here is the code: https://github.com/nathanganser/api-to-execute-python
For context, I'm thinking about building an app that needs to run user-inputted python code, and since I could not find a service that makes this easy, I just built an MVP of it.