0

How to search a string in JS file (multiple lines) in python?

with open(file, 'r') as f:
    for file_contents in f:
        if ('search_string_1' in file_contents) or ('search_string_2' in file_contents):
           print('match found!')
f.close()
Patrick Haugh
  • 55,247
  • 13
  • 83
  • 91
D09r
  • 1,343
  • 1
  • 11
  • 16

0 Answers0