Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import csv
  2. import json
  3.  
  4. inputfile = csv.reader(open('export_product_pixel-rs-class.csv'))
  5. bad_chars = [',','"','-','/','.','+','(',')',"'"]
  6. my_config = []
  7. for row in inputfile:
  8. place = row[0]
  9.  
  10. for i in bad_chars:
  11. place = place.replace(i,'')
  12.  
  13. #print (place)
  14.  
  15. my_config = {
  16. "keywords": str(place),
  17. "limit": 2,
  18. "print_urls": 'true'
  19. }
  20.  
  21. #print(my_config)
  22. with open('personal.json', 'w') as json_file:
  23. json.dump(my_config, json_file)
  24. print (my_config)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement