import os import sys cesta_vstup = 'text.txt' cesta_vystup = 'text_out.txt' if not os.path.exists(text_out.txt): print 'vstupni soubor nebyl nalezen!' sys.exit() cti = open(cesta_vstup, 'r') radky = cti.readlines() cti.close() for i in range(0,len(radky)): if radky[i][0].isdigit() == False: index_konec_hlavicky = i break hlavicka = radky[0:index_konec_hlavicky] telo = radky[index_konec_hlavicky:] zapis = open(cesta_vystup, 'w') zapis.writelines(hlavicka) for radek in radky: if 'black' in radek: black = radek.split()[1] print black for radek in radky: if 'white' in radek: white = radek.split()[1] print white a = black b = white c = black + white print c= 1122 :-D, i need convert it like int
YES!!!! i have it!!!!!!!!!! int(black)!! :-)))) i am happy :-D