Judge0 API Interface written in Python
Project description
CodeRunner 🏃
Judge0 API Interface written in Python
Prerequisites
- Python 3.6+
- virtualenv
Installation
- 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
Usage
- Install the package.
pip install 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 beMain
. - Currently supported languages :
- C (gcc 7.2.0)
- C++ (g++ 7.2.0)
- Java (OpenJDK 8)
- Python (3.6.0)
Author
👥 Bhupesh Varshney
- Twitter: @bhupeshimself
- DEV: bhupesh
📝 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.3.tar.gz
(3.8 kB
view hashes)