Created
March 16, 2019 12:21
-
-
Save ailinykh/dbcd18e783666852cc467e3714355015 to your computer and use it in GitHub Desktop.
Python file renaming
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
from os import walk, path, rename | |
import re | |
def main(): | |
for (_, _, filenames) in walk('.'): | |
for file in filenames: | |
if file.endswith('.png'): | |
name = re.sub('\-Arb', '_RTL', file) | |
rename(file, name) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment