Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('villages.txt')
- conn = sqlite3.connect('villages')
- c = conn.cursor()
- for line in file.readlines():
- c.execute('INSERT INTO village VALUES (?, ?, ?, ?, ?, ?, ?)', tuple(line.split(','))
- conn.commit()
- conn.close()
- file.close()
Add Comment
Please, Sign In to add comment