ããã¼ã³ã®ã¤ã³ã¿ã¼ãã«æ®å½±ã§æ®ããããåçãPhotoscanã«å
¥ããåã«éå¼ãããã°ã©ã ã§ãã
以ä¸ã®ããã«å®è¡ãã¾ãã
# python extract_photo.py Z:\DCIM
å¼æ°ã§æå®ãããã©ã«ãã®ä¸ã®jpgãä¸å®ã®å²åã§no_useãã©ã«ãã«ç§»åãã¾ãã
éå¼ãå²åã¯ããã°ã©ã ä¸ã®ratioã§æå®ãã¾ãã
no_useãã©ã«ãã¯ãæå®ãããã©ã«ãã®ä¸ã«ä½ããã¾ãã
# -*- coding: utf-8 -*- import glob import shutil import sys import os # 説æã¨ä½¿ãæ¹ # ããã¼ã³ã®ã¤ã³ã¿ã¼ãã«æ®å½±ã§æ®ããããåçãPhotoscanã«å ¥ããåã«éå¼ãããã°ã©ã # æå®ãããã©ã«ãã®ä¸ã®jpgãratioã®å²åã§no_useãã©ã«ãã«ç§»åããã # python extract_photo.py Z:\DCIM ratio = 2 #ä½æã«1æ移åãããã args = sys.argv search_dir = args[1] print(search_dir) files = glob.glob(search_dir + os.sep + '*.jpg') save_dir = search_dir + os.sep + "no_use" if not os.path.exists(save_dir): os.mkdir(save_dir) i=0 for file in files: if i % ratio == 0: shutil.move(file, save_dir) i = i+1