华清大学特普通奖学金初选报名系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
659 B

# This script should be runned in the root directory of the ordinary web
# This script will create contents.json and contents.txt in tmp/
# the only difference of them is the format.
import json, os
from app import *
contents = Candidate.query.all()
contents = list(map(lambda x: x.content, Candidate.query.all()))
contents = list(map(lambda s: s.replace('/r', ''), contents))
os.makedirs('tmp/', exist_ok = True)
with open('tmp/contents.json', 'w') as f:
json.dump(contents, f)
for i in range(len(contents)):
contents[i] = 'No. ' + str(i + 1) + ':\n' + contents[i]
with open('tmp/contents.txt', 'w') as f:
f.write('\n\n\n\n'.join(contents))