Skip to content

NJUST-FishTeam/ljudge-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}]}

About

python bindings for quark-zju/ljudge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages