hdknr / annotated-django

Django for Study
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

openpyxl: 'module' object has no attribute 'get_column_letter' #11

Closed hdknr closed 8 years ago

hdknr commented 8 years ago
hdknr commented 8 years ago
-from openpyxl import load_workbook, Workbook, cell
+from openpyxl import load_workbook, Workbook
+from openpyxl.utils import get_column_letter

     def writerow(self, row):
         for i in xrange(1, len(row) + 1):
-             ci = "{0}{1}".format(cell.get_column_letter(i), self.row)
+            ci = "{0}{1}".format(get_column_letter(i), self.row)
              self.sheet.cell(ci).value = force_unicode(row[i - 1])
          self.row += 1
shyed2001 commented 5 years ago

print(openpyxl.cell.get_column_letter(1))

does not work rather use print(openpyxl.utils.get_column_letter(1))