From 8c9395d6a0e07ea64a7ed88a466c5befb83178e3 Mon Sep 17 00:00:00 2001 From: 阳洁 <2077506045@qq.com> Date: 星期五, 28 七月 2023 18:42:59 +0800 Subject: [PATCH] 测评系统自动测试 --- comm/comm.py | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/comm/comm.py b/comm/comm.py new file mode 100644 index 0000000..70caebd --- /dev/null +++ b/comm/comm.py @@ -0,0 +1,17 @@ +import os +import random +import string + + +def listdir(dir_path): + file_names = [] + for filename in os.listdir(dir_path): + if os.path.isfile(os.path.join(dir_path, filename)): + if ".crdownload" not in filename: + file_names.append(filename) + return file_names + + +def generate_random_string(length): + letters = string.ascii_letters + string.digits + return ''.join(random.choice(letters) for _ in range(length)) -- Gitblit v1.9.1