mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2025-11-04 14:50:01 +08:00
add Python3 language support
This commit is contained in:
parent
93605e3081
commit
ecaf47fef4
@ -7,7 +7,7 @@ import json
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from languages import c_lang_config, cpp_lang_config, java_lang_config, c_lang_spj_config, \
|
from languages import c_lang_config, cpp_lang_config, java_lang_config, c_lang_spj_config, \
|
||||||
c_lang_spj_compile, py2_lang_config
|
c_lang_spj_compile, py2_lang_config, py3_lang_config
|
||||||
|
|
||||||
|
|
||||||
class JudgeServerClientError(Exception):
|
class JudgeServerClientError(Exception):
|
||||||
@ -102,6 +102,10 @@ if __name__ == "__main__":
|
|||||||
s1 = s.split(" ")
|
s1 = s.split(" ")
|
||||||
print int(s1[0]) + int(s1[1])"""
|
print int(s1[0]) + int(s1[1])"""
|
||||||
|
|
||||||
|
py3_src = """s = input()
|
||||||
|
s1 = s.split(" ")
|
||||||
|
print(int(s1[0]) + int(s1[1]))"""
|
||||||
|
|
||||||
client = JudgeServerClient(token=token, server_base_url="http://test.qduoj.com:12358")
|
client = JudgeServerClient(token=token, server_base_url="http://test.qduoj.com:12358")
|
||||||
print(client.ping(), "\n\n")
|
print(client.ping(), "\n\n")
|
||||||
|
|
||||||
@ -129,3 +133,7 @@ print int(s1[0]) + int(s1[1])"""
|
|||||||
print(client.judge(src=py2_src, language_config=py2_lang_config,
|
print(client.judge(src=py2_src, language_config=py2_lang_config,
|
||||||
max_cpu_time=1000, max_memory=128 * 1024 * 1024,
|
max_cpu_time=1000, max_memory=128 * 1024 * 1024,
|
||||||
test_case_id="normal"), "\n\n")
|
test_case_id="normal"), "\n\n")
|
||||||
|
|
||||||
|
print(client.judge(src=py3_src, language_config=py3_lang_config,
|
||||||
|
max_cpu_time=1000, max_memory=128 * 1024 * 1024,
|
||||||
|
test_case_id="normal"), "\n\n")
|
||||||
|
|||||||
@ -84,3 +84,19 @@ py2_lang_config = {
|
|||||||
"env": default_env
|
"env": default_env
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
py3_lang_config = {
|
||||||
|
"compile": {
|
||||||
|
"src_name": "solution.py",
|
||||||
|
"exe_name": "__pycache__/solution.cpython-35.pyc",
|
||||||
|
"max_cpu_time": 3000,
|
||||||
|
"max_real_time": 5000,
|
||||||
|
"max_memory": 128 * 1024 * 1024,
|
||||||
|
"compile_command": "/usr/bin/python3 -m py_compile {src_path}",
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"command": "/usr/bin/python3 {exe_path}",
|
||||||
|
"seccomp_rule": None,
|
||||||
|
"env": ["PYTHONIOENCODING=UTF-8"] + default_env
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user