Judge0 API Interface written in Python
- Python 3.6+
- virtualenv
- Create virtual environment.
virtualenv -p python3 venv && cd venv && source bin/activate- Clone the repository.
git https://github.com/codeclassroom/CodeRunner.git- Install Dependencies.
pip install -r requirements.txt- Run tests.
python3 tests.py- Install the package.
pip install coderunnerimport 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()))- In a
Javaprogram the class name should always beMain. - Currently supported languages :
- C (gcc 7.2.0)
- C++ (g++ 7.2.0)
- Java (OpenJDK 8)
- Python (3.6.0)
π₯ Bhupesh Varshney
- Twitter: @bhupeshimself
- DEV: bhupesh
This project is licensed under the MIT License. See the LICENSE file for details.
Please read the CONTRIBUTING file for the process of submitting pull requests to us.