Actually , I want to write
def w_cell(self, r, c, val, style=XLS.get_cell_stlye(self))
But it cannot, and show me the error
NameError: name 'self' is not defined
How could I set the default style in parameter rather than in function.
Thanks
class XLS():
def get_cell_stlye(self):
return xlwt.easyxf("alignment: horizontal center,\
vertical center, wrap true ;")
class TestCGI(object, XLS):
def w_cell(self, r, c, val, style='null'):
if style == 'null':
style=XLS.get_cell_stlye(self)
self.sht.write(r, c, val, style)