13 lines
No EOL
290 B
Python
13 lines
No EOL
290 B
Python
class Editor:
|
|
content: str = ''
|
|
print_func: function
|
|
|
|
def __init__(self, print_func: function=print):
|
|
self.print_func = print_func
|
|
pass
|
|
|
|
def add_character(self, char: str):
|
|
self.print_func(char)
|
|
|
|
def backspace(self):
|
|
self.print_func('^H') |