Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TextDocument:
- def __init__(self):
- self.textLines = []
- def get_text_lines(self):
- return self.textLines
- class TextEditor:
- def __init__(self):
- self.currentDocument = TextDocument()
- def add_text(self, line):
- self.currentDocument.textLines.append(line)
- def remove_text(self, line_index):
- if line_index < len(self.currentDocument.textLines):
- self.currentDocument.textLines.pop(line_index)
- def display_document(self):
- for line in self.currentDocument.get_text_lines():
- print(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement