import dataset db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4') table=db['seo_nton_custkw'] cust = "The Icons_ZH" kw = ['壯世代之春','壯世代','高齡解放','高齡解放運動','高齡化','少子化','戰國策 吳春城','戰國策 董事長','Strong Generation','政府社會責任'] print(cust, kw) for k in kw: if k != "" and cust != "": table.insert({'cust':cust,'kw':k}) else: print("Empty data")