mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-28 16:01:41 +00:00
add demo
This commit is contained in:
parent
8949f9d798
commit
50da8734d5
27
demo/demo.py
Normal file
27
demo/demo.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import _judger
|
||||||
|
import os
|
||||||
|
|
||||||
|
if os.system("gcc main.c -o main"):
|
||||||
|
print("compile error")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
ret = _judger.run(max_cpu_time=1000,
|
||||||
|
max_real_time=2000,
|
||||||
|
max_memory=128 * 1024 * 1024,
|
||||||
|
max_process_number=200,
|
||||||
|
max_output_size=10000,
|
||||||
|
max_stack=32 * 1024 * 1024,
|
||||||
|
# five args above can be _judger.UNLIMITED
|
||||||
|
exe_path="main",
|
||||||
|
input_path="1.in",
|
||||||
|
output_path="/dev/stdout",
|
||||||
|
error_path="/dev/stderr",
|
||||||
|
args=[],
|
||||||
|
# can be empty list
|
||||||
|
env=[],
|
||||||
|
log_path="judger.log",
|
||||||
|
# can be None
|
||||||
|
seccomp_rule_name="c_cpp",
|
||||||
|
uid=0,
|
||||||
|
gid=0)
|
||||||
|
print(ret)
|
8
demo/main.c
Normal file
8
demo/main.c
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
char input[1000];
|
||||||
|
scanf("%s", input);
|
||||||
|
printf("Hello %s\n", input);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user