title: How do I write only so many lines from a read file in python
body: <p>I have a csv that I am reading from and about 10-15 lines contain what the search parameters are but I only want to write a new file showing just 3 of them and cannot figure out how to do that.</p>
  
  <p><code>with open('events.csv', 'r', encoding = 'latin-1') as read_file, open('today.txt', 'w', encoding='latin-1') as write_file:
          reader = csv.reader(read_file, delimiter=',')
          writer = csv.writer(write_file)
          for row in reader:
              if day in row[0]:
                  writer.writerow(row)</code> </p>