Skip to content

codeclassroom/CodeRunner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeRunner πŸƒ

Judge0 API Interface written in Python

PyPI Build Status GitHub license GitHub issues PRs Welcome

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

  • 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 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.