For my dissertation at University, I\'m working on a coding leaderboard system where users can compile / run untrusted code through temporary docker containers. The system seems
I guess, you can use signals in python like unix to set timeout. you can use alarm of specific time say 50 seconds and catch it. Following link might help you.
signals in python