Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import sqlite3
  4. conexao = sqlite3.connect("locadora.db")
  5. cur = conexao.cursor()
  6.  
  7. comando = "update clientes set nome = 'Maria conceição' where codigo_cliente = 2"
  8. cur.fetchall()
  9. cur.execute(comando)
  10. conexao.commit()
  11. comando = "select * from clientes "
  12. cur.execute(comando)
  13. result = cur.fetchall()
  14.  
  15. for contato in result:
  16.     print("Codigo: %s\tNome: %s" %(contato[0],contato[1]))
  17.  
  18. conexao.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement