Advertisement
Guest User

Untitled

a guest
Jun 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #!/usr/local/bin/python3
  2.  
  3. import mysql.connector
  4.  
  5. con = mysql.connector.connect(host="localhost",database="blah",user="root",password="fullmoon")
  6.  
  7. cur = con.cursor()
  8.  
  9. query = ("select id, name from Object")
  10.  
  11. cur.execute(query)
  12.  
  13. for (id, name) in cur:
  14. print(str(id)+" "+str(name))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement