Answers for "how to find word in file python"

1

how to find word in file python

with open('example.txt') as f:
    if 'blabla' in f.read():
        print("true")
Posted by: Guest on February-14-2021
2

python read text file look for string

f = open(filename,  "r")
   whattoReturn = "None"
   if strToFind in f.read():
      whattoReturn = strToFind
Posted by: Guest on April-01-2020

Code answers related to "how to find word in file python"

Python Answers by Framework

Browse Popular Code Answers by Language