Question
A menu - you need to add the database and fill in the functions. def main(): menu_text = 1. Display all records
"""
A menu - you need to add the database and fill in the functions.
"""
def main():
menu_text = """
1. Display all records
2. Search by name
3. Add new record
4. Edit existing record
5. Delete record
6. Quit
"""
while True:
print(menu_text)
choice = input('Enter your choice: ')
if choice == '1':
display_all_records()
elif choice == '2':
search_by_name()
elif choice == '3':
add_new_record()
elif choice == '4':
edit_existing_record()
elif choice == '5':
delete_record()
elif choice == '6':
break
else:
print('Not a valid selection, please try again')
def display_all_records():
print('todo display all records')
def search_by_name():
print('todo ask user for a name, and print the matching record if found. What should the program do if the name is not found?')
def add_new_record():
print('todo add new record. What if user wants to add a record that already exists?')
def edit_existing_record():
print('todo edit existing record. What if user wants to edit record that does not exist?')
def delete_record():
print('todo delete existing record. What if user wants to delete record that does not exist?')
if __name__ == '__main__':
main()
Lab 5: SQLite and Peewee Starter code with menu: https://gist.github.com/claraj /13a8b31b73b8cfec9c4e665cdc70d39e Here is some data on chainsaw juggling records, Chainsaw Juggling Record Holders as of July 2018 EITHER part 1: Simple SQLite application. Build a Python application which stores the following example data in a SQLite database. Use the sqlite3 library, and write SQL statements. - Your program should let the user search for a record holder, by name - Your program should display all the record holders in the database - Your program should let the user add a new row for a record holder. - You should be able to update the number of catches for a record holder. - And, you should be able to delete a record, by record holder's name (for example, if a person's record was found to be invalid). Use parameterized statements where appropriate. OR Part 2: Peewee. Build the same program but use Peewee. You should still be able to add, edit, insert, and delete records from your database. To think about; how are the two ways to interact with a database different? Which do you prefer? When might you use one, and when might you use the other
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started