I wish to implement an online judge system in Linux using python. I need to restrict computing resource(time, memory) for process. Process should terminate when it uses more resources than given.
Also, when a program terminates, I need to know whether it terminates normally, or terminates because of run time error (stack over flow, divide by zero, accessing invalid address), or using more resource than given.
How to do it in python?
resource.setrlimit()
http://docs.python.org/library/resource.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With