Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- import json
- inputfile = csv.reader(open('export_product_pixel-rs-class.csv'))
- bad_chars = [',','"','-','/','.','+','(',')',"'"]
- my_config = []
- for row in inputfile:
- place = row[0]
- for i in bad_chars:
- place = place.replace(i,'')
- #print (place)
- my_config.append( {
- "keywords": str(place),
- "limit": 2,
- "print_urls": 'true'
- } )
- #print(my_config)
- with open('personal.json', 'w') as json_file:
- json.dump(my_config, json_file, indent=True)
- # print (my_config)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement