Welcome to the Treehouse Community
Looking to learn something new?
Daniel Tompkins5,591 Points
I'm struggling to figure out a way of passing "clear()" while keeping messages like "Entry saved!" etc.
It bothers me that we lose important feedback from the program like "Entry saved!" and "Entry was deleted successfully!". Is there a way that we don't have to compromise the clean interface "clear()" gives us with each action for these feedback messages?
"""View previous entries.""" entries = Entry.select().order_by(Entry.timestamp.desc()) if search_query: if Entry.content.contains(search_query): entries = entries.where(Entry.content.contains(search_query)) else: print("Entry does not exist. Check for mispelled words and try again!") for entry in entries: timestamp = entry.timestamp.strftime('%A %B %d, %Y %I:%M%p') clear() print(timestamp) print('='*len(timestamp)) print(entry.content) print('\n\n'+'='*len(timestamp)) print('n) next entry') print('d) delete entry') print('q) return to main menu')