def main(): menu = """ Escolha uma das opções: 1) Cadastrar 2) Verificar 3) Sair """ menu_opts = { '1': cadastrar, '2': verificar, '3': sair, } nbio.init() nbio.open() while True: print menu menu_opt = raw_input('>>> ') menu_action = menu_opts.get(menu_opt) if menu_action is None: print 'Error: Opção inválida' else: menu_action()
import nbio print 'INIT:', nbio.init() print 'OPEN:', nbio.open() print 'GET_INFO:', nbio.get_info() print 'SET_INFO:', nbio.set_info(50, 5000) print 'GET_INFO:', nbio.get_info() text = nbio.enroll() print 'ENROLL:', text print 'VERIFY:', nbio.verify(text) print 'ENROLL TEXT1' text1 = nbio.enroll() print 'ENROLL TEXT2' text2 = nbio.enroll() print 'VERIFY_MATCH:', nbio.verify_match(text1, text2) print 'CLOSE:', nbio.close()