Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. file = open('villages.txt')
  2. conn = sqlite3.connect('villages')
  3. c = conn.cursor()
  4. for line in file.readlines():
  5. c.execute('INSERT INTO village VALUES (?, ?, ?, ?, ?, ?, ?)', tuple(line.split(','))
  6. conn.commit()
  7. conn.close()
  8. file.close()
Add Comment
Please, Sign In to add comment