i have struggle with the problem and get my solusion:
with open("clusters.csv", "r") as data_file:
all_words = []
for line in data_file.readlines():
for word in line.split("'. "):
all_words.append(word.lower())
unique_words = set(all_words)
i = 0
xlen = len(unique_words)
xlist = list(unique_words)
while i <= (xlen):
x = xlist[i].find(";"); # längd
x1 = xlist[i].find(",") # 1 comma plats
x2 = x1 + xlist[i].find(",") # 2 comma plats
x3 = xlist[i].find(")") # ) plats
ww = (xlist[i][0:x]) # clusterdata
rr = int(ww[1:x1]) # röd
gg = int(ww[x1+2:x2+1]) # grön
bb = int(ww[x2+3:x3]) # blue
korr_value = (rr, gg, bb, 255)
pixel_value = (rr, gg, bb, 255)
print korr_value
filename = ( str(rr)+"_"+str(gg)+"_"+str(bb) )
suffix = ".png"
thanks to all that hav toughtabout it.
with open("clusters.csv", "r") as data_file:
all_words = []
for line in data_file.readlines():
for word in line.split("'. "):
all_words.append(word.lower())
unique_words = set(all_words)
i = 0
xlen = len(unique_words)
xlist = list(unique_words)
while i <= (xlen):
x = xlist[i].find(";"); # längd
x1 = xlist[i].find(",") # 1 comma plats
x2 = x1 + xlist[i].find(",") # 2 comma plats
x3 = xlist[i].find(")") # ) plats
ww = (xlist[i][0:x]) # clusterdata
rr = int(ww[1:x1]) # röd
gg = int(ww[x1+2:x2+1]) # grön
bb = int(ww[x2+3:x3]) # blue
korr_value = (rr, gg, bb, 255)
pixel_value = (rr, gg, bb, 255)
print korr_value
filename = ( str(rr)+"_"+str(gg)+"_"+str(bb) )
suffix = ".png"
thanks to all that hav toughtabout it.