code: def read_csv(csv_file, options, ensemble_list=None):
      
      name, ext = os.path.splitext(csv_file)
      try:
          if ext == '.gz':
              f = gzip.open(csv_file, 'rb')
          else:
              f = open(csv_file, 'rU')
      except IOError:
          print(" \n '{f}' could not be opened\n".format(f=os.path.basename(csv_file)))
          sys.exit(1)
  
  
      csv_reader = csv.reader(f)
      molList = []
      line_number = 1
  
      for line in csv_reader:
  
          if line_number == 1:
              if ensemble_list:
                  prop_indices = read_header(line, options, ensemble_list)
              else:
                  prop_indices = read_header(line, options)
          else:
              mol = Molecule()
              if ensemble_list:
                  mol = read_line(line, options, prop_indices, mol, ensemble_list)
              else:
                  mol = read_line(line, options, prop_indices, mol)
              if mol == 1:
                  print(" skipping molecule {m}\n".format(m=(line_number - 1)))
              else:
                  molList.append(mol)
          line_number += 1
  
      return molList
docs: Read csv and return molList, otherwise print error and exit.