Browse Source

🚚 Script to auto-resort tutorial src files

pull/11/head
Sebastián Ramírez 6 years ago
parent
commit
f539217b5b
  1. 15
      scripts/rename_tutorial_src_files.py

15
scripts/rename_tutorial_src_files.py

@ -0,0 +1,15 @@
#%%
from pathlib import Path
from string import digits
#%%
directory = Path("../docs/tutorial/src")
output_directory = Path("../docs/tutorial/out")
files = sorted([Path(f) for f in directory.iterdir()])
for i, f in enumerate(files):
f: Path
index = str(i + 1).zfill(2)
new_name = output_directory / f"tutorial{index}.py"
print(new_name)
f.rename(new_name)
Loading…
Cancel
Save