Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
SavedText(list) solution in Clear category for Text Editor by flpo
class Text:
text = font = ''
def write(self, text):
self.text += text
def restore(self, old):
self.text, self.font = old
def set_font(self, font):
self.font = f'[{font}]'
def show(self):
return f'{self.font}{self.text}{self.font}'
class SavedText(list):
get_version = list.__getitem__
def save_text(self, text):
self.append((text.text, text.font))
June 27, 2018
Comments: