from wordcloud import WordCloud Z=[] sonad=[] for rida in open("sonaseosed.txt", encoding="utf-8"): m=rida.strip().split(",") Z.append([int(m[1]), int(m[2]), float(m[3]), int(m[4])]) for rida in open("sonaindeksid.txt", encoding="utf-8"): sonad.append(rida.strip().split(",")[1]) def uuriPuu(indeks, sygavus=0): if indeks300: f=open("puu8_kogused/300/"+str(round(sygavus,2))+"_"+str(indeks)+"_"+vastus.split()[0]+".txt", "w", encoding="utf-8") print(vastus, file=f) f.close() return "" return vastus uuriPuu(len(sonad)+len(Z)-1)