GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python_reference/useful_scripts/find_file.py at master · nickwork/python_reference Expand file tree/ Copy pathfind_file.pyMore file actions 18 lines (14 loc) · 417 Bytes / Copy pathfind_file.pyFile metadata and controls18 lines (14 loc) · 417 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Sebastian Raschka 2014 # # A Python function to find files in a directory based on a substring search. import os def find_files(substring, path): results = [] for f in os.listdir(path): if substring in f: results.append(os.path.join(path, f)) return results # E.g. # find_files('Untitled', '/Users/sebastian/Desktop/') # returns # ['/Users/sebastian/Desktop/Untitled0.ipynb'] |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |