Any other way to import data files(like .csv) in python sqlite3 module ? [not insert one by one]
问题 In sqlite3's client CLI, there is " .import file TABLE_name " to do it. But, I do not want to install sqlite3 to my server at present. In python sqlite3 module, we can creat and edit a DB. But, I have not found a way to import data-file to a TABLE, except inserting rows one by one. Any other way? 回答1: You could insert at one shot using executemany command instead of inserting one by one Lets say I have users.csv with following contents "Hugo","Boss" "Calvin","Klein" and basically open with