Created
July 29, 2013 09:45
-
-
Save cloverrose/6103278 to your computer and use it in GitHub Desktop.
JPEGminiで圧縮したファイルのファイル名を_mini.jpgから.jpgにリネームするスクリプト
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
# -*- coding:utf-8 -*- | |
""" | |
JPEG miniで小さくしたファイルの_mini.jpgを.jpgにリネームするスクリプト | |
""" | |
import os | |
from os.path import join | |
def main(): | |
for root, dirs, files in os.walk('.'): | |
for name in (x for x in files if x.endswith('_mini.jpg')): | |
os.rename(join(root, name), join(root, name.replace('_mini.jpg', '.jpg'))) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment