Jump to content


storing values of a request in a MySQL - database (an easy one)

  • Please log in to reply
1 reply to this topic

#1 apollo_moon_driver

  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 06 July 2014 - 11:29 AM

i have a dictionary  - THIS IS obviously a python dictionary

an this has approx 8 000 lines with records


$ python printer.py
{'url': 'http://www.site1_com' 'cname': 'butcher', 'name': 'cheng', 'email': 'mail1@hotmail.com'}
{'url': 'http://www.site2_com' 'cname': 'dilbert', 'name': 'James', 'email': 'mail2@hotmail.com'}

[code=auto:0]i have a mysql-db up and runing in my opensuse

there i have created a db with the fields


i use the

import MySQLdb

i studied this documentation here: http://stackoverflow...abase-in-python

but i think this goes a bit over my head.

- well how can i get the data  ( in other words the dictionary) into the database?

love to hear from you


#2 QuickOldCar

  • Moderators
  • Advanced Member
  • 2,995 posts
  • LocationNorthEast Pennsylvania

Posted 25 October 2014 - 06:58 AM

Have a look at Mysql Connector/Python


MySQL Connector/Python enables Python programs to access MySQL databases


Coding examples

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users