|
1 | | -# Initial page |
| 1 | +# CodeRunner π |
2 | 2 |
|
| 3 | +> [Judge0 API](https://api.judge0.com/) Interface written in Python |
| 4 | +
|
| 5 | + |
| 6 | +[](https://travis-ci.org/codeclassroom/CodeRunner) |
| 7 | +[](https://github.com/codeclassroom/CodeRunner/blob/master/LICENSE) |
| 8 | +[](https://github.com/codeclassroom/CodeRunner/issues) |
| 9 | +[](http://makeapullrequest.com) |
| 10 | + |
| 11 | + |
| 12 | +### Prerequisites |
| 13 | +1. Python 3.6+ |
| 14 | +2. virtualenv |
| 15 | + |
| 16 | +### Installation |
| 17 | +1. Create virtual environment. |
| 18 | +```bash |
| 19 | +virtualenv -p python3 venv && cd venv && source bin/activate |
| 20 | +``` |
| 21 | +2. Clone the repository. |
| 22 | +```bash |
| 23 | +git https://github.com/codeclassroom/CodeRunner.git |
| 24 | +``` |
| 25 | +3. Install Dependencies. |
| 26 | +```bash |
| 27 | +pip install -r requirements.txt |
| 28 | +``` |
| 29 | +4. Run tests. |
| 30 | +```bash |
| 31 | +python3 tests.py |
| 32 | +``` |
| 33 | + |
| 34 | +### Usage |
| 35 | +- Install the package. |
| 36 | +```bash |
| 37 | +pip install coderunner |
| 38 | +``` |
| 39 | + |
| 40 | +```python |
| 41 | +import coderunner |
| 42 | +import pprint |
| 43 | +program_name = "testfiles/" + "test_python.py" |
| 44 | +language = "Python" |
| 45 | +output = "testfiles/" + "output2.txt" |
| 46 | +Input = "testfiles/" + "input.txt" |
| 47 | +r = coderunner.Run(program_name, language, output, Input) |
| 48 | +print("Status : " + r.getStatus()) |
| 49 | +if r.getError() != None: |
| 50 | + pprint.pprint("Error : " + r.getError()) |
| 51 | +else: |
| 52 | + print("Standard Output : ") |
| 53 | + pprint.pprint(r.getStandardOutput()) |
| 54 | +print("Execution Time : " + r.getTime()) |
| 55 | +print("Memory : " + str(r.getMemory())) |
| 56 | +``` |
| 57 | + |
| 58 | + |
| 59 | +### Pointers β |
| 60 | +- In a `Java` program the class name should always be ***`Main`***. |
| 61 | +- Currently supported languages : |
| 62 | + - C (gcc 7.2.0) |
| 63 | + - C++ (g++ 7.2.0) |
| 64 | + - Java (OpenJDK 8) |
| 65 | + - Python (3.6.0) |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +### Author |
| 70 | + |
| 71 | +π₯ **Bhupesh Varshney** |
| 72 | + |
| 73 | +- Twitter: [@bhupeshimself](https://twitter.com/bhupeshimself) |
| 74 | +- DEV: [bhupesh](https://dev.to/bhupesh) |
| 75 | + |
| 76 | +## π License |
| 77 | + |
| 78 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
| 79 | + |
| 80 | +## π Contributing |
| 81 | + |
| 82 | +Please read the [CONTRIBUTING](CONTRIBUTING.md) file for the process of submitting pull requests to us. |
0 commit comments