From 15abb18267944cc300e33555e3e1f76bd0daf10d Mon Sep 17 00:00:00 2001 From: virusdefender Date: Tue, 4 Oct 2016 13:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=AC=A1=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E6=97=B6=E5=80=99=E7=9A=84=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/Python/client.py | 2 +- compiler.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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