Add python as a language #8
Merged
Merged
Conversation
…ite recursion loop
Add Python as a language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces multi-language support for coding challenges, specifically adding Python as an alternative to JavaScript. It does so by extending the backend data model to support challenge variants per language, seeding Python variants for all challenges, and implementing a secure Python code runner service using Docker and Flask. The frontend is updated to allow users to select a language, edit code in that language, and run tests accordingly. The main changes are grouped below:
Backend: Multi-language Challenge Support
ChallengeVariantentity and repository to represent and store language-specific variants (starter code and harness templates) for each challenge. TheChallengemodel now has avariantsfield for these. [1] [2] [3]DataSeeder.java) to add Python variants for all seeded challenges, including harness templates and starter code for Python. [1] [2] [3] [4] [5] [6] [7] [8]Runner Service: Secure Python Execution
runnerservice (Dockerized Flask app) that safely executes user-submitted Python code using a harness template, reading input from stdin and returning structured JSON results. Includes error and timeout handling. [1] [2] [3]docker-compose.ymland frontendnginx.confto include and route requests to the new runner service. [1] [2]Frontend: Language Selection and Execution
These changes collectively enable users to solve challenges in multiple languages, with secure and isolated execution for Python code.