It can run Python, Ruby, C, and C++ code in a sandbox and supporting other
languages is easy.
This library uses the ``iospec`` format for specifying the expected inputs and
outputs for the some program execution. For more info, refer to the iospec_
manual.
.. _iospec: https://readthedocs.org/iospec/
Command line
============
The ``ejudge`` accepts two sub-commands:
``$ ejudge run <source> <inputs>``:
Runs the given input source code and passes all inputs defined
in the <inputs> file. The inputs may be either a simple text file with one
input per line or an IoSpec source file with an `.iospec` extension.
``$ ejudge grade <source> <iospec inputs>``:
Runs the input source code and compares the result with the given IoSpec
test cases. It than returns a feedback message telling if the code ran as
expected and, in case of errors, what are the probable problems.
Library
=======
The main entry points in the :mod:`ejudge` module are the :func:`ejudge.run` and
:func:`ejudge.grade` functions. The first is responsible for running code against
a set of inputs and collect the resulting IO. The second function runs code and
compares it with the expected iospec result.
>>> from ejudge import run
>>> src = 'print("hello %s!" % input("name: "))'
>>> inputs = ['john']
>>> spec = run(src, inputs, lang='python')
>>> list(spec[0]) # fetch the first test case
[Out('name: '), In('john'), Out('hello john!')]
Metadata
Release files for ejudge 0.5.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ejudge-0.5.17.tar.gz | 24.3 kB | Without provenance | Details for ejudge-0.5.17.tar.gz |
Release files / ejudge-0.5.17.tar.gz
| Download URL | ejudge-0.5.17.tar.gz |
|---|---|
| Size | 24.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fbeaca7e3941f17ad1f48ffea038f1d711ff63a3bf4f2466052a068b4a602ee
|
|
BLAKE2b-256 checksum How to use checksums |
15bce38802df4bc09b8f5f93735edb9ef043b757da33841b1e442db3e9e9be88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ejudge 0.5.17
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.