Created
February 23, 2017 22:00
-
-
Save marcoscastro/2d7fb3919b38d16f1a8a74058d9088f1 to your computer and use it in GitHub Desktop.
Código corrigido POO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def buscar_email(self, email): | |
| """Busca um cliente pelo email""" | |
| try: | |
| cursor = self.conexao.cursor() | |
| # obtém todos os dados | |
| cursor.execute("SELECT * FROM clientes WHERE email = ?",[(email)]) | |
| cliente = cursor.fetchone() | |
| if cliente: | |
| print('True') | |
| else: | |
| print('False') | |
| except AttributeError: | |
| print('Faça a conexão do banco antes de buscar clientes.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment