We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2f79eb commit 12b293fCopy full SHA for 12b293f
src/generator.py
@@ -1,5 +1,6 @@
1
import os
2
import shutil
3
+import zipfile
4
from pathlib import Path
5
6
from src.problem import Problem
@@ -54,4 +55,7 @@ def generate(self):
54
55
self._logger.info("打包测试数据")
56
path_zip = self._path / "testcase.zip"
57
path_zip.unlink(missing_ok=True)
- os.system(f"7z a -tzip {path_zip} {PATH_TMP_FOLDER / '*.in'} {PATH_TMP_FOLDER / '*.out'}")
58
+ with zipfile.ZipFile(path_zip, "w") as zip_file:
59
+ for file in PATH_TMP_FOLDER.iterdir():
60
+ if file.suffix in [".in", ".out"]:
61
+ zip_file.write(file, file.name)
0 commit comments