Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. def main():
  2. queryObtainID = "SELECT ProductID FROM products WHERE ProductCode = "
  3. queryObtainImages = "SELECT ProductImage FROM productimages WHERE ProductID = "
  4. db = mysql.connector.connect(user=db_username, password=db_password, host=db_hostname, database=db_name)
  5. file = "export (1).csv"
  6. with open(file, 'rb') as f:
  7. reader = csv.reader(f)
  8. rownum = 0
  9. for row in reader:
  10. if rownum == 0:
  11. header = row[0]
  12. rownum += 1
  13. else:
  14. productCode = str(row[0])
  15. obtainImages(db,productCode, queryObtainID, queryObtainImages)
  16.  
  17. int(float(row[0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement