Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import shutil
- import os
- import sys
- dr = sys.argv[3]
- for root, dirs, files in os.walk(dr):
- for file in files:
- if file == "index.html":
- spl = root.split("/"); newname = spl[-3]; sup = ("/").join(spl[:-3])
- shutil.move(root+"/"+file, sup+"/"+newname+".html"); shutil.rmtree(root)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement