Guide · Content
The code runner (executor), in simple words
How readers' Python code for /python-practice is run safely, away from the website.
For: admins and authorsPage 15 of 71
Overview
Readers on /python-practice can write Python and press Run. Running a stranger's code is risky, so it never runs inside the website.
- The website checks the reader is signed in and within their limits, then sends the code and only the test inputs (never the expected answers) to the executor.
- The executor puts the job in a queue. A dispatcher starts a brand-new, throw-away sandbox for each job.
- The sandbox has no internet, no passwords and no access to anything else. It uses gVisor, a protective layer between the code and the real server. Time, memory, file size and output are all capped.
- The sandbox prints the results; the dispatcher reads them and deletes the sandbox.
- The website compares the outputs with the expected answers itself, so a cheating program cannot fake a pass. Progress, XP and badges are then given exactly once.
Repeated abuse (for example endless loops) blocks the account for 15 minutes. Admins manage problems, roles, topics, the daily challenge, the AI tutor and abuse signals under Python practice.
Diagram
Where to find it
This page of the admin: /admin/practice. Admins and authors can open it.