title: How to write lists into excel columns with openpyxl
body: <p>I am attempting write some code to iterate over columns containing UK postcodes in excel and a userID, pass them into a function that returns the time and distance between these postcodes, saves them to a list then writes these lists as columns in excel. The function so far seems to be working as I would like with mostly correct looking distances/times that have the same index in their respective lists as the userID does in its own. From this point though I am uncertain how to create columns with openpyxl in either the original workbook or a new one.</p>
  <p>Any help with creating excel columns from these lists or finding a better method entirely would be appreciated. Thanks in advance.</p>
  <pre><code>wb = load_workbook('workbook.xlsx')
  ws = wb['sheetname']
  
   def dist_time_finder(ID, origin, destination):
          dist_time_matrix = gmaps.distance_matrix(origin, destination, mode='driving', units='imperial', region='gb')
          distance = dist_time_matrix['rows'][0]['elements'][0]['distance']['text']
          time = dist_time_matrix['rows'][0]['elements'][0]['duration']['text']
          return ID, time, distance
      
      col_E_list = [] #list of origin points
      col_G_list = [] #list of destinations
      col_A_list = [] #list of user ids
      time_list = []
      distance_list = []
      UserID_list = []
  for cell in ws['E']:
      col_E_list.append(cell.value)
  for cell in ws['G']:
      col_G_list.append(cell.value)
  for cell in ws['A']:
      col_A_list.append(cell.value)
  results = zip(col_A_list, col_E_list, col_G_list)
  results = list(results)
  for id, origin, destination in results:
      try:
          user_id, time, distance = dist_time_finder(id, origin, destination)
          UserID_list.append(user_id)
          time_list.append(time)
          distance_list.append(distance)
      except(KeyError, TypeError):
          pass  
  </code></pre>