Skip to main content

Judge0 API Interface written in Python

Project description

CodeRunner 🏃

Judge0 API Interface written in Python

GitHub license GitHub issues PRs Welcome GitHub commit activity

Prerequisites

  1. Python 3.6+
  2. virtualenv

Installation

  1. Create virtual environment.
virtualenv -p python3 venv && cd venv && source bin/activate
  1. Clone the repository.
git https://github.com/codeclassroom/CodeRunner.git
  1. Install Dependencies.
pip install -r requirements.txt
  1. Run tests.
python3 tests.py

Usage

from coderunner import coderunner
import pprint

program_name = "testfiles/" + "test_python.py"
language = "Python"
output = "testfiles/" + "output2.txt"
Input = "testfiles/" + "input.txt"
r = coderunner.Run(program_name, language, output, Input)

print("Status : " + r.getStatus())
if r.getError() != None:
	pprint.pprint("Error : " + r.getError())
else:
	print("Standard Output : ")
	pprint.pprint(r.getStandardOutput())
print("Execution Time : " + r.getTime())
print("Memory : " + str(r.getMemory()))

Pointers ✏

  • In a Java program the class name should always be Main.
  • Currently supported languages :
    • C (gcc 7.2.0)
    • C++ (g++ 7.2.0)
    • Java (OpenJDK 8)
    • Python (3.6.0)

Author

👥 Bhupesh Varshney

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

👋 Contributing

Please read the CONTRIBUTING file for the process of submitting pull requests to us.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coderunner-0.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

coderunner-0.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page