def ask_find_contact(): try: phone = contacts.find_contact(e_name.get()) e_phone.delete(0, END) e_phone.insert(0, phone) except ValueError as e: tkMessageBox.showerror("Error", e)
def found(): if 'search' in request.args: try: name = request.args['search'] phone = contacts.find_contact(name) return render_template('find.html', name=name, phone=phone) except ValueError as e: return render_template('find.html', message=e) return render_template('find.html')