-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfind_photos.py
31 lines (22 loc) · 931 Bytes
/
find_photos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Walk a folder and write the path of all files matching the search type.
Edit the Config object below as needed for each execution.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from io import open
import os
class Config(object):
"""Namespace for configuration parameters. Edit as necessary."""
# pylint: disable=useless-object-inheritance,too-few-public-methods
out_list = r"C:\tmp\list2.txt"
search_folder = (
r"T:\PROJECTS\AKR\FMSS\TRAILS\Data\DENA\2015_FMSSMapping\SavageAlpine"
)
extensions = [".jpg", ".jpeg"]
with open(Config.out_list, "w", encoding="utf-8") as out_file:
for (root, _, files) in os.walk(Config.search_folder):
for name in files:
_, ext = os.path.splitext(name)
if ext.lower() in Config.extensions:
out_file.write(os.path.join(root, name) + "\n")