Created
July 27, 2020 09:03
-
-
Save HarshCasper/b296d565b073a72e3877f2297f77a567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
folder = r'Project Path' | |
for filename in os.listdir(folder): | |
infilename = os.path.join(folder, filename) | |
if not os.path.isfile(infilename): continue | |
oldbase = os.path.splitext(filename) | |
newname = infilename.replace('.txt', '.js') | |
output = os.rename(infilename, newname) | |
print("Complete") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment