Advertisement
MertcanGokgoz

ilceler sql

Dec 30th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import csv
  2.  
  3. file = open('../Data/turkiye_ilceler_12042017.csv')
  4. Read = csv.reader(file)
  5. Data = list(Read)
  6.  
  7. sql = open('../Data/CityDistrict.sql', 'w')
  8.  
  9. for Read in Data:
  10.     for i in range(1, 970):
  11.         x = '''INSERT INTO "District" ("Province_id", "District") VALUES (%s, '%s');\n''' % (Data[i][2], Data[i][1])
  12.         sql.write(x)
  13.  
  14. sql.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement