Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Ashley Keeling](https://uploads.teamtreehouse.com/production/profile-photos/9240312/micro_background-mountains.jpg)
Ashley Keeling
11,476 Pointsthe quit part of the function isn't working
i am not sure if it is supposed to but in the video it worked for him, everything else is working
!/usr/bin/env python3
from collections import OrderedDict import datetime
from peewee import *
db = SqliteDatabase('diary.db')
class Entry(Model): content = TextField() # content timestamp = DateTimeField(default=datetime.datetime.now) # timestamp
class Meta:
database = db
def initialize(): """create the database and the table if they font exist""" db.connect() db.create_tables([Entry], safe=True)
def menu_loop(): """SHOW THE MENU""" choice = None
while None != 'q':
print("enter 'q' to quit")
for key, value in menu.items():
print("{}) {}".format(key, value.__doc__))
choice = input('Action: ').lower().strip()
if choice in menu:
menu[choice]()
def add_entry(): """add an entry"""
def view_entries(): """view previous enteries"""
def delete_entry(entry): """delete an entry"""
menu = OrderedDict([ ('a', add_entry), ('v', view_entries), ])
if name=='main': initialize() menu_loop()
1 Answer
![Krishna Pratap Chouhan](https://secure.gravatar.com/avatar/8c46996a3e9af1329e084ea8434377ea?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Krishna Pratap Chouhan
15,203 Pointswhile None != 'q':
did you meant choice != 'q'