Created
April 9, 2016 22:03
-
-
Save waghcwb/80330a35d742a984ab1ca4b9b568350c 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os, re | |
regex = 'bandeira-(.*)-(.*)\.(.*)' | |
directory = '.' | |
for filename in os.listdir(directory): | |
name = re.search(regex, filename) | |
if name: | |
name = '{filename}.{ext}'.format(filename=name.group(1), ext=name.group(3)) | |
os.rename(filename, name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment