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
  • 59,226
  • 13
  • 88
  • 96
D09r
  • 1,411
  • 1
  • 12
  • 16

0 Answers0