Browse Source

上传文件至 'be'

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

+ 18
- 14
be/app.py View File

@ -53,20 +53,24 @@ def get_problem_description(_id: str):
samples = json.loads(des[-1].replace("\n", "\\n"))
samples_html = ''
for s in samples:
_input = s["input"].strip().replace(" ", "&nbsp;&nbsp;").replace("\n", "<br/>")
_output = s["output"].strip().replace(" ", "&nbsp;&nbsp;").replace("\n", "<br/>")
str1 = '<div>'
str2 = '<div style="display:inline-block;width:45%;vertical-align:top;">'
str3 = '<div><strong style="font-size:20px">Input</strong></div><br/>'
str4 = '<div>' + _input + '</div>'
str5 = '</div>'
str6 = '<div style="display:inline-block;width:45%;vertical-align:top;">'
str7 = '<div><strong style="font-size:20px">Output</strong></div><br/>'
str8 = '<div>' + _output + '</div>'
str9 = '</div>'
str0 = '</div><br/>'
samples_html = samples_html + str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + str0
return title + description + input_description + output_description + samples_html, 200
_input = s["input"].strip().replace(" ", "&nbsp;&nbsp;").replace("\n", "<br/>&nbsp;&nbsp;&nbsp;&nbsp;")
_output = s["output"].strip().replace(" ", "&nbsp;&nbsp;").replace("\n", "<br/>&nbsp;&nbsp;&nbsp;&nbsp;")
# _input = s["input"].strip().replace(" ", "&nbsp;&nbsp;")
# _output = s["output"].strip().replace(" ", "&nbsp;&nbsp;")
stra = '<div>'
strb = '<div style="width:100%;">'
strc = '<div style="display:inline-block;width:45%;vertical-align:top;"><strong style="font-size:20px;color:blue;">Input</strong></div>'
strd = '<div style="display:inline-block;width:2%;vertical-align:top;"></div>'
stre = '<div style="display:inline-block;width:45%;vertical-align:top;"><strong style="font-size:20px;color:blue;">Output</strong></div>'
strf = '</div><br/>'
strg = '<div style="width:100%;">'
strh = '<div style="display:inline-block;width:45%;height:100%;vertical-align:top;border:0.5px solid;border-radius:5px;"><br/>&nbsp;&nbsp;&nbsp;&nbsp;' + _input + '<br/>&nbsp;&nbsp;&nbsp;&nbsp;</div>'
stri = '<div style="display:inline-block;width:2%;height:100%;vertical-align:top;"></div>'
strj = '<div style="display:inline-block;width:45%;height:100%;vertical-align:top;border:0.5px solid;border-radius:5px;"><br/>&nbsp;&nbsp;&nbsp;&nbsp;' + _output + '<br/>&nbsp;&nbsp;&nbsp;&nbsp;</div>'
strk = '</div>'
strl = '</div><br/>'
samples_html = samples_html + stra + strb + strc + strd + stre + strf + strg + strh + stri + strj + strk + strl
return title + description + input_description + output_description + samples_html, 200
@app.route('/case_test/', methods=['POST'])

Loading…
Cancel
Save