Answers for "python search files"

5

how to search for a specific file extension with python

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Posted by: Guest on March-06-2020
0

file searching in python

with open('largeFile', 'r') as inF:
    for line in inF:
        if 'myString' in line:
            # do_something
Posted by: Guest on September-06-2021

Code answers related to "python search files"

Python Answers by Framework

Browse Popular Code Answers by Language