Created
April 2, 2015 14:30
-
-
Save ejmurray/718cce11a9d35543d00c to your computer and use it in GitHub Desktop.
Rename files using python os command
This file contains hidden or 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
__author__ = 'Ernest' | |
import os | |
for textfiles in os.listdir("."): | |
if textfiles.startswith("P") and textfiles.endswith('.txt'): | |
os.rename(textfiles, textfiles.replace("P", "p", 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment