Guest User

Untitled

a guest
Dec 9th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import os
  2.  
  3.  
  4. def rename_html_to_php():
  5. for filename in os.listdir("."):
  6. if os.path.isdir(filename):
  7. os.chdir("./"+filename)
  8. rename_html_to_php()
  9. os.chdir("..")
  10. if filename.endswith(".html"):
  11. print(filename, "changed !")
  12. os.rename(filename, filename.replace(".html", ".php"))
  13.  
  14.  
  15. if __name__ == "__main__":
  16. rename_html_to_php()
Add Comment
Please, Sign In to add comment