mardi 27 septembre 2016

Display select Mysql query in python with output nice and readable

I need python script for display sql query with nice output and readable this not readable for heavy tables...

     cnx = mysql.connector.connect(user='root', password='*****',
                          host='127.0.0.1',
                          database='dietetique')
    c = cnx.cursor()
   sys.stdout = open('mysql_data.log', 'w')
   c.execute("SELECT * FROM administrations;")

  for row in c:

  print row




Aucun commentaire:

Enregistrer un commentaire