Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def rename_html_to_php():
- for filename in os.listdir("."):
- if os.path.isdir(filename):
- os.chdir("./"+filename)
- rename_html_to_php()
- os.chdir("..")
- if filename.endswith(".html"):
- print(filename, "changed !")
- os.rename(filename, filename.replace(".html", ".php"))
- if __name__ == "__main__":
- rename_html_to_php()
Add Comment
Please, Sign In to add comment