'Set the current cell from the entry widget.'

def change_cell(self):

    (x, y) = self.currentxy
    text = self.entry.get()
    cell = None
    if text.startswith('='):
        cell = FormulaCell(text[1:])
    else:
        for cls in (int, float, complex):
            try:
                value = cls(text)
            except (TypeError, ValueError):
                continue
            else:
                cell = NumericCell(value)
                break
    if ((cell is None) and text):
        cell = StringCell(text)
    if (cell is None):
        self.sheet.clearcell(x, y)
    else:
        self.sheet.setcell(x, y, cell)
    self.sync()
