12345678910111213141516 |
- import dataset
- import codecs
- db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
- table=db['selected_kw']
- fr=codecs.open('C:\\tmp\\selected.csv','r','utf-8')
- lines=fr.readlines()
- lst=[]
- for l in lines:
- term=l.replace('\n','')
- term=term.replace('\r','')
- table.insert({'term':term,'client':'清原'})
|