Sir_CussFreq - 2015-03-20

The /pyexcel_xlsx/init.py file needs to have 'get_columns' updated, with the '- 1' seen below. Without this, it skips columns AA-AZ and goes straight from Z to BA. This small script demonstrates the issue with the return (original line currently commented out, fixed line is the corrected code)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#!/usr/bin/env python

COLUMNS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
COLUMN_LENGTH = 26

def get_columns(index):
    if index < COLUMN_LENGTH:
        return COLUMNS[index]
    else:
        print "nope"
        return (get_columns(int(index / COLUMN_LENGTH - 1)) + COLUMNS[index % COLUMN_LENGTH])
#        return (get_columns(int(index / COLUMN_LENGTH)) +
#                COLUMNS[index % COLUMN_LENGTH])

TESTVAR = get_columns(26)
print TESTVAR
 

Last edit: Sir_CussFreq 2015-03-20