diff --git a/client/Python/client.py b/client/Python/client.py index e93eed1..dddb50c 100644 --- a/client/Python/client.py +++ b/client/Python/client.py @@ -99,7 +99,7 @@ if __name__ == "__main__": print client.compile_spj(src=c_spj_src, spj_version="1", spj_compile_config=c_lang_config["spj_compile"], test_case_id="spj"), "\n\n" - print client.judge(src=c_src, language_config=c_lang_config, submission_id=str(int(time.time())), + print client.judge(src=c_src, language_config=c_lang_config, submission_id="0", max_cpu_time=1000, max_memory=1024 * 1024 * 128, test_case_id="normal"), "\n\n" diff --git a/compiler.py b/compiler.py index c061299..dcc1dee 100644 --- a/compiler.py +++ b/compiler.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import json import os +import time import _judger @@ -15,7 +16,7 @@ class Compiler(object): command = compile_config["compile_command"] exe_path = os.path.join(output_dir, compile_config["exe_name"]) command = command.format(src_path=src_path, exe_dir=output_dir, exe_path=exe_path) - compiler_out = os.path.join(output_dir, "compiler.out") + compiler_out = os.path.join(output_dir, str(time.time()) + "-compiler.out") _command = command.split(" ") result = _judger.run(max_cpu_time=compile_config["max_cpu_time"], @@ -43,4 +44,5 @@ class Compiler(object): raise CompileError(error) raise CompileError("Compiler runtime error, info: %s" % json.dumps(result).decode("utf-8")) + os.remove(compiler_out) return exe_path