Browse Source

上传文件至 'be'

pull/3/head
gitea.shuishan 3 years ago
parent
commit
18c29630b9
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      be/app.py

+ 11
- 3
be/app.py View File

@ -18,7 +18,7 @@ db = pymysql.connect(host='192.168.0.89',
user='root',
password='2020yunjisuan!',
db='shuishan',
charset='utf8')
charset='utf8mb4')
@app.route('/get-problem-items/')
@ -77,8 +77,13 @@ def get_problem_description(_id: str):
def case_test_():
pid: str = request.json.get("pid")
code: str = request.json.get("code")
pid = str(pid)
code = str(code)
with open('wulin.txt', 'w', encoding='utf-8', newline='') as f:
f.write(pid)
f.write(pid+"\n")
f.write(code + "\n")
f.close()
results = testcase.submit_handler(code, pid, 'C')
@ -108,8 +113,11 @@ def check_logic_error():
def submit():
pid: str = request.json.get("pid")
code: str = request.json.get("code")
pid = str(pid)
code = str(code)
with open('wulin2.txt', 'w', encoding='utf-8', newline='') as f:
f.write(pid)
f.write(pid + "\n")
f.write(code + "\n")
f.close()
results = mysubmit.submit_handler(code, pid, 'C')

Loading…
Cancel
Save