Blame view

MODFIRE-Prototype/res/initialize_regions.py 415 Bytes
df0e5c82   Eduardo Eloy   added region para...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import csv, re, sqlite3

con = sqlite3.connect("database_modfire.db")
cur = con.cursor()
f2 = open("region_init.txt", "w+")


toWrite = ''


for i in range(0, 1406):
	cur.execute("SELECT region FROM region_int where ug like "+str(i)) 
	result = cur.fetchall()
	toWrite = str(result[0]).replace(')','').replace('(','')
	toWrite = toWrite[:-2]+"\n"
	toWrite = toWrite[1:]
	f2.write(toWrite)
	toWrite = ''

f2.close()