Skip to content

Instantly share code, notes, and snippets.

@tuankiet65
Created March 14, 2019 18:13
Show Gist options
  • Save tuankiet65/da6d3a6ff1f2d39d5f682ab6edf24657 to your computer and use it in GitHub Desktop.
Save tuankiet65/da6d3a6ff1f2d39d5f682ab6edf24657 to your computer and use it in GitHub Desktop.
from pathlib import Path
TASK_NAME = Path().absolute().name
i = 1
while True:
old_in = Path(f"{i}.in")
old_out = Path(f"{i}.out")
if (not old_in.exists()) and (not old_out.exists()):
exit()
new_folder = Path(f"Test{i:02}")
new_in = new_folder / f"{TASK_NAME}.inp"
new_out = new_folder / f"{TASK_NAME}.out"
new_folder.mkdir()
old_in.replace(new_in)
old_out.replace(new_out)
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment