Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.02 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.02 KB

ljudge-py

PyPI version

python bindings for ljudge

Installation

First install ljudge

Install ljudge-py with pip:

$ pip install ljudge

Usage

import ljudge

opts = {
    'user-code': 'ac.c',
    'max-cpu-time': '1.0',
    'max-compiler-cpu-time': '10',
    'max-memory': '32m',
    'testcase': [
        {
            'input': '1.in',
            'output': '1.out',
        },
        {
            'input': '2.in',
            'output': '2.out',
        }
    ],
}

ljudge.run(opts)

#{u'compilation': {u'log': u'a.c: In function \'main\':\na.c:5:6: warning: ignoring return value of \'scanf\', declared with attribute warn_unused_result [-Wunused-result]\n scanf("%d%d", &a, &b);\n      ^', u'success': True}, u'testcases': [{u'time': 0.001, u'result': u'ACCEPTED', u'memory': 225280}, {u'time': 0.001, u'result': u'WRONG_ANSWER', u'memory': 225280}]}