title: How to store wise data in a chunks in multiple csv files from list of tuples
body: <p>I have a list of tuples and I need to write this data in multiple CSV files based on ranges like 500 data in each and every CSV file.</p>
  <p>The example of data_list:</p>
  <pre><code>data_list = [(10.01,20.11),(34,20),(33,88),(44,90),(43,99)]
  </code></pre>
  <p>In above list I want two tuple in one csv file. so form this I will be having 3 csv file.</p>
  <pre><code>output_csv_file_01.csv 
  output_csv_file_02.csv
  output_csv_file_03.csv
  </code></pre>
  <p>I need multiple CSV files with the data_list data, with the given range.
  for example: If I have 20000 data in the list, but I want only 5000 data rows in each csv file. so my output will be 4 csv files, each contains 5000 rows.</p>
  <pre><code>output_csv_file_01.csv 
  output_csv_file_02.csv
  output_csv_file_03.csv
  output_csv_file_04.csv
    
  </code></pre>
  <p>I have this code snipit:</p>
  <pre><code>field = ['A','B']
  data_list = [(10.01,20.11),(34,20),(33,88),(44,90),(43,99)]
  with open(csv_filename, 'w') as csvfile:
      fieldnames = fieldnames
      writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
      writer.writeheader()       
      if data_list:
          for row in data_list:
          writer.writerow(
                          {&quot;A&quot;: row[0],
                           &quot;B&quot;: row[1]})
      else:
          print(&quot;{} {} not found&quot;.format(row[0], row[1]))
  </code></pre>