Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- conn = psycopg2.connect("dbname='nome_do_banco'user='postgres'host='localhost'password='postgres'");
- cur = conn.cursor()
- def verifica_campos(self):
- usuario = unicode(self.campo_escrever_usuario.text())
- senha = unicode(self.campo_escrever_senha.text())
- cur.execute("SELECT * FROM usuarios where email_usuario = %s and senha_usuario = %s", (usuario,senha,))
- print(cur.fetchone())
- if cur.rowcount > 0:
- self.abre_tela_principal()
- else:
- self.mensagem_erro_login(_fromUtf8('Atenção!'), _fromUtf8('Usuário ou Senha incorretos!'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement