delete codeup category and update README.md and complete 2467.py and 27433.py and create new run.py and init_make.py for better testcases management
This commit is contained in:
31
init_make.py
Normal file
31
init_make.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
|
||||
TC_TARGET_DIR = "_testcases"
|
||||
|
||||
DEFAULT_COUNT = 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
count = DEFAULT_COUNT
|
||||
match len(sys.argv):
|
||||
case 1:
|
||||
pass
|
||||
case 2 if sys.argv[1].isdigit() and int(sys.argv[1]) > 0:
|
||||
count = int(sys.argv[1])
|
||||
case _:
|
||||
print("Invalid arguments.")
|
||||
sys.exit()
|
||||
|
||||
# default make
|
||||
if not os.path.exists("./" + TC_TARGET_DIR):
|
||||
os.mkdir(TC_TARGET_DIR)
|
||||
|
||||
for i in range(1, count + 1):
|
||||
default_in_path = "./" + TC_TARGET_DIR + f"/{i}.in"
|
||||
default_out_path = "./" + TC_TARGET_DIR + f"/{i}.out"
|
||||
with open(default_in_path, "w", encoding="utf-8") as _:
|
||||
pass
|
||||
|
||||
with open(default_out_path, "w", encoding="utf-8") as _:
|
||||
pass
|
||||
Reference in New Issue
Block a user