scope - Python: Using .join to concatenate items in a list of strings within an enumerate for loop and receiving an unexpected output -


main problem: cant figure out why output file not writing verses 1:6 , 1:23. want figure out why , how fix it.

i'm new python , don't quite understand if it's logic or misunderstanding of how things work in python that's leading me astray. using .join concatenate items in list of strings within enumerate loop , receiving unexpected output. specifically, using python parse .txt file. .txt file contains data on words in bible. want new output.txt read such new bible verses coincide new lines. problem is, python script wrote skipping on verse 6 , verse 23 on test data output. suspect has how i'm using .join in parallel loop , lack of understanding how works in python. however, understand committed logical error. here code. note debug statements, .join use in functions defined , how affect strings parsing in outer loop ("where think error @ wrong").

def concatenatenext_string_tf( index, lines_list):     next_wl_index = index + 1     if next_wl_index < len(lines_list):         #thisis variable word_list: tric splitin string list of words         problem_var = lines_list[next_wl_index]         problem_words2 = problem_var.split()         #check if vere or glitch start in middle of verse         if ( (problem_words2[0].isdigit() < 8) , (':' not in problem_words2[0]) ):             return true      return false      #debug: condition_string, real_index def concatenatenext_string( index, lines_list, condition_string, real_index):     next_wl_index = index + 1     if next_wl_index < len(lines_list):         #thisis variable word_list: tric splitin string list of words         problem_var = lines_list[next_wl_index]         problem_words2 = problem_var.split()          if ( (problem_words2[0].isdigit() < 8) , (':' not in problem_words2[0]) ):             print problem_words2[0]+condition_string+"[index:"+real_index+"]" #debug             #add space next doesnt join lastw list , firstw next             #then join line , next             #then replace word_list             lines_list[index+1] = " "+lines_list[index+1]             lines_list[index:index+2] = [''.join(lines_list[index:index+2])]             word_list = lines_list[index].split()      return word_list   #open file input_file = open( "/users/carlosgarzon/desktop/projects/learnhtml/bereshit/bereshitpython/data_chapter1.txt", "r")  #read file list of lines lines_list = input_file.read().splitlines()  # close file stream handler input_file.close()  # open function returns file object write_file = open("/users/carlosgarzon/desktop/projects/learnhtml/bereshit/bereshitpython/out_main_js.txt","w")  # writing variable file in loop index, var_list in enumerate(lines_list):      #gltich: string not beging verse begins i.e genesis 1:7      #tric splitin string list of words     #this used if nothing glitch     word_list = var_list.split()      #get number of words in verse     num_word_lists = len(lines_list)      #if current , next string glitch join current previous     if ( (word_list[0].isdigit() < 8) , (':' not in word_list[0]) ) , concatenatenext_string_tf( index, lines_list):         word_list = concatenatenext_string( index - 1, lines_list, "[cur&nextglitch]", str(index) )     #catches if next string glitch      if concatenatenext_string_tf( index, lines_list):         word_list = concatenatenext_string( index, lines_list, "[nextglitch]", str(index) )     #if current string glitch join previous     elif ( (word_list[0].isdigit() < 8) , (':' not in word_list[0]) ):         word_list = concatenatenext_string( index - 1, lines_list, "[curglitch]", str(index) )      #not including c:v , starting on 0 index     num_words = len(word_list) - 1      index2, word in enumerate(word_list):         if len(word_list) > 1:             #bad data: references, page title, (c)              if ( index2 == 0 , word.isdigit() ) or ( word_list[0] == 'the' , word_list[1] == 'mechanical' ) or ( word_list[1] == 'jeff' ):                 print "bad data"                 break          #debug: found new verse. it's printing index of outer loop not 1         if ':' in word:             print word+ "  " + word_list[1]+"("+str(index)+")"+"\n"          write_file.write(word+"("+str(index2)+")")      #exit inner loop             write_file.write("numwordsinverse("+str(num_words)+")"+"\n")  # close file object in python write_file.close 

here file i'm reading from. note how new lines in middle of verses. output file, i'll show next eliminates these glitches. problem is, in output file notice data skips on verse 1:6 , verse 1:23.

this file i'm reading from. condensed bit , replaced parts ......

    1:1 in~summit 2363 בְּרֵאשִׁית bê'rey'shit he~did~fatten(v) 232 בָּרָּא ba'ra elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֵת eyt the~sky 2512~s2 הַשָּמַיִׁם ha'sha'ma'yim and~at 85 וְּאֵת wê'eyt the~land 2331 הָּאָרֶץ ha'a'rets 1:2 and~the~land 2331 וְּהָּאָרֶץ wê'ha'a'rets she~did~exist(v) 505 הָּיְּתָּה hai'tah confusion 2623 תֹהוּ to'hu and~unfilled 106 וָּבֹהוּ wa'vo'hu and~darkness 2439 וְּחֹשֶךְ wê'hho'shekh upon 1616 עַל al face 1815~s פְּנֵי pê'ney deep.sea 522 תְּהוֹם tê'hom and~wind 2251 וְּרוּחַַ wê'ru'ahh elohiym power~s אֱלֹהִׁים e'lo'him much~flutter(v) 787~ing(fs) מְּרַחֶפֶת mê'ra'hhe'phet upon 1616 עַל al face 1815~s פְּנֵי pê'ney the~water 1162~s2 הַמָּיִׁם ha'ma'yim 1:3 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him he~will~exist(v) 505 יְּהִׁי yê'hi light 73 אוֹר or and~he~will~exist(v) 505 וַיְּהִׁי wai'hi light 73 אוֹר or 1:4 and~he~will~see(v) 2185 וַיַרְּא wai'yar elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֶת et the~light 73 הָּאוֹר ha'or given.that 940 כִׁי ki functional 848 טוֹב tov and~he~will~make~separate(v) 100 וַיַבְּדֵל wai'yav'deyl elohiym power~s אֱלֹהִׁים e'lo'him between 193 בֵין beyn the~light 73 הָּאוֹר ha'or and~between 193 וּבֵין u'veyn the~darkness 2439 הַחֹשֶךְ ha'hho'shekh 1:5 and~he~will~call.out(v) 2147 וַיִׁקְּרָּא wai'yiq'ra elohiym power~s אֱלֹהִׁים e'lo'him to~light 73 לָּאוֹר la'or day 898 יוֹם yom and~to~darkness 2439 וְּלַחֹשֶךְ wê'la'hho'shekh he~did~call.out(v) 2147 קָּרָּא qa'ra night 1111 לָּיְּלָּה lai'lah and~he~will~exist(v) 505 וַיְּהִׁי wai'hi evening 2724 עֶרֶב e'rev and~he~will~exist(v) 505 וַיְּהִׁי wai'hi morning 1861 בֹקֶר vo'qer day 898 יוֹם yom unit 636 אֶחָּד e'hhad 1:6 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him he~will~exist(v) 505 יְּהִׁי yê'hi sheet 2118 רָּקִׁיעַַ ra'qi'a in~midst 2631 בְּתוֹךְ bê'tokh the~water 1162~s2 הַמָּיִׁם ha'ma'yim and~he~will~exist(v) 505 וִׁיהִׁי wi'hi make~separate(v) 100~ing(ms) מַבְּדִׁיל mav'dil between 193 בֵין beyn water 1162~s2 מַיִׁם ma'yim to~water 1162~s2 לָּמָּיִׁם la'ma'yim 1:7 and~he~will~do(v) 1686 וַיַעַשׂ wai'ya'as elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֶת et the~sheet 2118 הָּרָּקִׁיעַַ ha'ra'qi'a and~he~will~make~separate(v) 100 וַיַבְּדֵל wai'yav'deyl between 193 בֵין beyn the~water 1162~s2 הַמַיִׁם ha'ma'yim 2589 אֲשֶר a'sher from~under 2627 מִׁתַחַת mi'ta'hhat to~sheet 2118 לָּרָּקִׁיעַַ la'ra'qi'a and~between 193 וּבֵין u'veyn the~water 1162~s2 הַמַיִׁם ha'ma'yim 2589 אֲשֶר a'sher from~upon 1616 מֵעַל mey'al to~sheet 2118 לָּרָּקִׁיעַַ la'ra'qi'a and~he~will~exist(v) 505 וַיְּהִׁי wai'hi 968 כֵן kheyn2 1:8 and~he~will~call.out(v) 2147 וַיִׁקְּרָּא wai'yiq'ra elohiym power~s אֱלֹהִׁים e'lo'him to~sheet 2118 לָּרָּקִׁיעַַ la'ra'qi'a sky 2512~s2 שָּמָּיִׁם sha'ma'yim and~he~will~exist(v) 505 וַיְּהִׁי wai'hi evening 2724 עֶרֶב e'rev and~he~will~exist(v) 505 וַיְּהִׁי wai'hi morning 1861 בֹקֶר vo'qer day 898 יוֹם yom second 2541 שֵנִׁי shey'ni 1:9 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him he~will~be~bound.up(v) 2060 יִׁקָּווּ yi'qaw'u the~water 1162~s2 הַמַיִׁם ha'ma'yim from~under 2627 מִׁתַחַת mi'ta'hhat the~sky 2512~s2 הַשָּמַיִׁם ha'sha'ma'yim 26 אֶל el area 2092 מָּקוֹם ma'qom unit 636 אֶחָּד e'hhad and~she~be~see(v) 2185 וְּתֵרָּאֶה wê'tey'ra'eh the~dry.ground 258 הַיַבָּשָּה hai'ya'ba'shah and~he~will~exist(v) 505 וַיְּהִׁי wai'hi 968 כֵן kheyn3 1:10 and~he~will~call.out(v) 2147 וַיִׁקְּרָּא wai'yiq'ra elohiym power~s אֱלֹהִׁים e'lo'him to~dry.ground 258 לַיַבָּשָּה lai'ya'ba'shah land 2331 אֶרֶץ e'rets and~to~collection 2061 וּלְּמִׁקְּוֵה ul'miq'weh the~water 1162~s2 הַמַיִׁם ha'ma'yim he~did~call.out(v) 2147 קָּרָּא qa'ra sea 895~s יַמִׁים ya'mim and~he~will~see(v) 2185 וַיַרְּא wai'yar elohiym power~s אֱלֹהִׁים e'lo'him given.that 940 כִׁי ki functional 848 טוֹב tov 1 skies , land "fattened" in sense of being "filled up." 2 phrase "and exist so" means "and firmly established." 3 phrase "and exist so" means "and firmly established." mechanical translation of torah book of genesis © jeff a. benner page 3 www.mechanical-translation.org ............................................ 1:22 and~he~will~much~kneel(v) 236 וַיְּבָּרֶךְ wai'va'rekh @ 85~them(mp) אֹתָּם o'tam elohiym power~s אֱלֹהִׁים e'lo'him to~>~say(v) 1187 לֵאמֹר ley'mor !(mp)~reproduce(v) 1858 פְּרוּ pê'ru and~!(mp)~increase(v) 2197 וּרְּבוּ ur'vu and~!(mp)~fill(v) 1192 וּמִׁלְּאוּ u'mil'u @ 85 אֶת et the~water 1162~s2 הַמַיִׁם ha'ma'yim in~the~sea 895~s בַיַמִׁים ba'ya'mim and~the~flyer 1701 וְּהָּעוֹף wê'ha'oph he~did~increase(v) 2197 יִׁרֶב yi'rev in~the~land 2331 בָּאָרֶץ ba'a'rets 1:23 and~he~will~exist(v) 505 וַיְּהִׁי wai'hi evening 2724 עֶרֶב e'rev and~he~will~exist(v) 505 וַיְּהִׁי wai'hi morning 1861 בֹקֶר vo'qer day 898 יוֹם yom fifth 1271 חֲמִׁישִׁי hha'mi'shi 1:24 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him she~will~make~go.out(v) 1922 תוֹצֵא to'tsey the~land 2331 הָּאָרֶץ ha'a'rets being 1902 נֶפֶש ne'phesh living 667 חַיָּה hhai'yah to~kind 1216~her לְּמִׁינָּהּ lê'mi'nah beast 178 בְּהֵמָּה bê'hey'mah and~treader 2313 וָּרֶמֶשׂ wa're'mes and~living 667~him וְּחַיְּתוַֹ wê'hhai'to2 land 2331 אֶרֶץ e'rets to~kind 1216~her לְּמִׁינָּהּ lê'mi'nah and~he~will~exist(v) 505 וַיְּהִׁי wai'hi 968 כֵן kheyn3 1:25 and~he~will~do(v) 1686 וַיַעַשׂ wai'ya'as elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֶת et living 667 חַיַת hhai'yat the~land 2331 הָּאָרֶץ ha'a'rets to~kind 1216~her לְּמִׁינָּהּ lê'mi'nah and~at 85 וְּאֶת wê'et the~beast 178 הַבְּהֵמָּה ha'be'hey'mah to~kind 1216~her לְּמִׁינָּהּ lê'mi'nah and~at 85 וְּאֵת wê'eyt 957 כָּל kol treader 2313 רֶמֶשׂ re'mes the~ground 425 הָּאֲדָּמָּה ha'a'da'mah to~kind 1216~him לְּמִׁינֵהוּ lê'mi'ney'hu and~he~will~see(v) 2185 וַיַרְּא wai'yar elohiym power~s אֱלֹהִׁים e'lo'him given.that 940 כִׁי ki functional 848 טוֹב tov 1:26 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him we(cp)~will~do(v) 1686 נַעֲשֶׂה na'a'seh human 424 אָדָּם a'dam in~image 1971~us(cp) בְּצַלְּמֵנוּ bê'tsal'mey'nu like~likeness 431~us(cp) כִׁדְּמוּתֵנוּ kid'mu'tey'nu and~he~did~rule(v) 2235 וְּיִׁרְּדוּ wê'yir'du in~fish 395 בִׁדְּגַת vid'gat the~sea 895 הַיָּם hai'yam and~in~flyer 1701 וּבְּעוֹף uv'oph the~sky 2512~s2 הַשָּמַיִׁם ha'sha'ma'yim and~in~the~beast 178 וּבַבְּהֵמָּה u'va'be'hey'mah and~in~all 957 וּבְּכָּל uv'khol the~land 2331 הָּאָרֶץ ha'a'rets and~in~all 957 וּבְּכָּל uv'khol the~treader 2313 הָּרֶמֶשׂ ha're'mes the~tread(v) 2312~ing(ms) הָּרֹמֵשׂ ha'ro'meys upon 1616 עַל al the~land 2331 הָּאָרֶץ ha'a'rets 1:27 and~he~will~fatten(v) 232 וַיִׁבְּרָּא wai'yiv'ra elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֶת et the~human 424 הָּאָדָּם ha'a'dam in~image 1971~him בְּצַלְּמוַֹ bê'tsal'mo in~image 1971 בְּצֶלֶם bê'tse'lem elohiym power~s אֱלֹהִׁים e'lo'him 1 hebrew word translated in various ways including; whale, sea-monster, dragon, serpent, asp , jackal (see exodus 7:9, deuteronomy 32:33, nehemiah 2:13, job 7:12). according these texts large creature , lives on land , in water, charecteristics of crocodile. 2 hebrew literally reads "his living ones," may written defectively. 3 phrase "and existed so" hebraicly means "and firmly established." mechanical translation of torah book of genesis © jeff a. benner page 5 www.mechanical-translation.org he~did~fatten(v) 232 בָּרָּא ba'ra @ 85~him אֹתוַֹ o'to male 1024 זָּכָּר za'khar and~female 2043 וּנְּקֵבָּה un'qey'vah he~did~fatten(v) 232 בָּרָּא ba'ra @ 85~them(mp) אֹתָּם o'tam 1:28 and~he~will~much~kneel(v) 236 וַיְּבָּרֶךְ wai'va'rekh @ 85~them(mp) אֹתָּם o'tam elohiym power~s אֱלֹהִׁים e'lo'him and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer to~them(mp) לָּהֶם la'hem elohiym power~s אֱלֹהִׁים e'lo'him !(mp)~reproduce(v) 1858 פְּרוּ pê'ru and~!(mp)~increase(v) 2197 וּרְּבוּ ur'vu and~!(mp)~fill(v) 1192 וּמִׁלְּאוּ u'mil'u @ 85 אֶת et the~land 2331 הָּאָרֶץ ha'a'rets and~!(mp)~subdue(v) 205~her וְּכִׁבְּשֻׁהַָּ wê'khiv'shu'ah and~!(mp)~rule(v) 2235 וּרְּדוּ ur'du in~fish 395 בִׁדְּגַת bid'gat the~sea 895 הַיָּם hai'yam and~in~flyer 1701 וּבְּעוֹף uv'oph the~sky 2512~s2 הַשָּמַיִׁם ha'sha'ma'yim and~in~all 957 וּבְּכָּל uv'khol living 667 חַיָּה hhai'yah the~tread(v) 2312~ing(fs) הָּרֹמֶשֶׂת ha'ro'me'set upon 1616 עַל al the~land 2331 הָּאָרֶץ ha'a'rets 1:29 and~he~will~say(v) 1187 וַיֹאמֶר wai'yo'mer elohiym power~s אֱלֹהִׁים e'lo'him 526 הִׁנֵה hin'neyh i(cs)~did~give(v) 2659 נָּתַתִׁי na'ta'ti to~you(mp) לָּכֶם la'khem @ 85 אֶת et 957 כָּל kol herb 1691 עֵשֶׂב ey'sev sow(v) 605~ing(ms) זֹרֵעַַ zo'rey'a seed 606 זֶרַע ze'ra 2589 אֲשֶר a'sher upon 1616 עַל al face 1815~s פְּנֵי pê'ney 957 כָּל khol the~land 2331 הָּאָרֶץ ha'a'rets and~at 85 וְּאֶת wê'et 957 כָּל kol the~tree 1706 הָּעֵץ ha'eyts 2589 אֲשֶר a'sher in~him בוַֹ bo produce 1859 פְּרִׁי phê'ri tree 1706 עֵץ eyts sow(v) 605~ing(ms) זֹרֵעַַ zo'rey'a seed 606 זָּרַע za'ra to~you(mp) לָּכֶם la'khem he~will~exist(v) 505 יִׁהְּיֶה yih'yeh to~food 949 לְּאָכְּלָּה lê'akh'lah 1:30 and~to~all 957 וּלְּכָּל ul'khol living 667 חַיַת hhai'yat the~land 2331 הָּאָרֶץ ha'a'rets and~to~all 957 וּלְּכָּל ul'khol flyer 1701 עוֹף oph the~sky 2512~s2 הַשָּמַיִׁם ha'sha'ma'yim and~to~all 957 וּלְּכֹל ul'khol tread(v) 2312~ing(ms) רוֹמֵשׂ ro'meys upon 1616 עַל al the~land 2331 הָּאָרֶץ ha'a'rets 2589 אֲשֶר a'sher in~him בוַֹ bo being 1902 נֶפֶש ne'phesh living 667 חַיָּה hhai'yah @ 85 אֶת et 957 כָּל kol green 2349 יֶרֶק ye'req herb 1691 עֵשֶׂב ey'sev to~food 949 לְּאָכְּלָּה lê'akh'lah and~he~will~exist(v) 505 וַיְּהִׁי wai'hi 968 כֵן kheyn1 1:31 and~he~will~see(v) 2185 וַיַרְּא wai'yar elohiym power~s אֱלֹהִׁים e'lo'him @ 85 אֶת et 957 כָּל kol 2589 אֲשֶר a'sher he~did~do(v) 1686 עָּשָּׂה a'sah and~look 526 וְּהִׁנֵה wê'hin'neyh functional 848 טוֹב tov many 8 מְּאֹד mê'od and~he~will~exist(v) 505 וַיְּהִׁי wai'hi evening 2724 עֶרֶב e'rev and~he~will~exist(v) 505 וַיְּהִׁי wai'hi morning 1861 בֹקֶר vo'qer day 898 יוֹם yom the~sixth 2613 הַשִׁשִׁי ha'shi'shi2 

here output. main problem v 1:6 , v 1:23 being skipped over. want find out why , how fix it.

here output file. condensed bit , replaced parts ......

    1:1(0)in~summit(1)2363(2)בְּרֵאשִׁית(3)bê'rey'shit(4)he~did~fatten(v)(5)232(6)בָּרָּא(7)ba'ra(8)elohiym(9)power~s(10)אֱלֹהִׁים(11)e'lo'him(12)at(13)85(14)אֵת(15)eyt(16)the~sky(17)2512~s2(18)הַשָּמַיִׁם(19)ha'sha'ma'yim(20)and~at(21)85(22)וְּאֵת(23)wê'eyt(24)the~land(25)2331(26)הָּאָרֶץ(27)ha'a'rets(28)numwordsinverse(28)     1:2(0)and~the~land(1)2331(2)וְּהָּאָרֶץ(3)wê'ha'a'rets(4)she~did~exist(v)(5)505(6)הָּיְּתָּה(7)hai'tah(8)confusion(9)2623(10)תֹהוּ(11)to'hu(12)and~unfilled(13)106(14)וָּבֹהוּ(15)wa'vo'hu(16)and~darkness(17)2439(18)וְּחֹשֶךְ(19)wê'hho'shekh(20)upon(21)1616(22)עַל(23)al(24)face(25)1815~s(26)פְּנֵי(27)pê'ney(28)deep.sea(29)522(30)תְּהוֹם(31)tê'hom(32)and~wind(33)2251(34)וְּרוּחַַ(35)wê'ru'ahh(36)elohiym(37)power~s(38)אֱלֹהִׁים(39)e'lo'him(40)much~flutter(v)(41)787~ing(fs)(42)מְּרַחֶפֶת(43)mê'ra'hhe'phet(44)upon(45)1616(46)עַל(47)al(48)face(49)1815~s(50)פְּנֵי(51)pê'ney(52)the~water(53)1162~s2(54)הַמָּיִׁם(55)ha'ma'yim(56)numwordsinverse(56)     1:3(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)he~will~exist(v)(9)505(10)יְּהִׁי(11)yê'hi(12)light(13)73(14)אוֹר(15)or(16)and~he~will~exist(v)(17)505(18)וַיְּהִׁי(19)wai'hi(20)light(21)73(22)אוֹר(23)or(24)numwordsinverse(24)     1:4(0)and~he~will~see(v)(1)2185(2)וַיַרְּא(3)wai'yar(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)the~light(13)73(14)הָּאוֹר(15)ha'or(16)given.that(17)940(18)כִׁי(19)ki(20)functional(21)848(22)טוֹב(23)tov(24)and~he~will~make~separate(v)(25)100(26)וַיַבְּדֵל(27)wai'yav'deyl(28)elohiym(29)power~s(30)אֱלֹהִׁים(31)e'lo'him(32)between(33)193(34)בֵין(35)beyn(36)the~light(37)73(38)הָּאוֹר(39)ha'or(40)and~between(41)193(42)וּבֵין(43)u'veyn(44)the~darkness(45)2439(46)הַחֹשֶךְ(47)ha'hho'shekh(48)numwordsinverse(48)     1:5(0)and~he~will~call.out(v)(1)2147(2)וַיִׁקְּרָּא(3)wai'yiq'ra(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)to~light(9)73(10)לָּאוֹר(11)la'or(12)day(13)898(14)יוֹם(15)yom(16)and~to~darkness(17)2439(18)וְּלַחֹשֶךְ(19)wê'la'hho'shekh(20)he~did~call.out(v)(21)2147(22)קָּרָּא(23)qa'ra(24)night(25)1111(26)לָּיְּלָּה(27)lai'lah(28)and~he~will~exist(v)(29)505(30)וַיְּהִׁי(31)wai'hi(32)evening(33)2724(34)עֶרֶב(35)e'rev(36)and~he~will~exist(v)(37)505(38)וַיְּהִׁי(39)wai'hi(40)morning(41)1861(42)בֹקֶר(43)numwordsinverse(43)     1:5(0)and~he~will~call.out(v)(1)2147(2)וַיִׁקְּרָּא(3)wai'yiq'ra(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)to~light(9)73(10)לָּאוֹר(11)la'or(12)day(13)898(14)יוֹם(15)yom(16)and~to~darkness(17)2439(18)וְּלַחֹשֶךְ(19)wê'la'hho'shekh(20)he~did~call.out(v)(21)2147(22)קָּרָּא(23)qa'ra(24)night(25)1111(26)לָּיְּלָּה(27)lai'lah(28)and~he~will~exist(v)(29)505(30)וַיְּהִׁי(31)wai'hi(32)evening(33)2724(34)עֶרֶב(35)e'rev(36)and~he~will~exist(v)(37)505(38)וַיְּהִׁי(39)wai'hi(40)morning(41)1861(42)בֹקֶר(43)vo'qer(44)day(45)898(46)יוֹם(47)yom(48)unit(49)636(50)אֶחָּד(51)e'hhad(52)numwordsinverse(52)     1:7(0)and~he~will~do(v)(1)1686(2)וַיַעַשׂ(3)wai'ya'as(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)the~sheet(13)2118(14)הָּרָּקִׁיעַַ(15)ha'ra'qi'a(16)and~he~will~make~separate(v)(17)100(18)וַיַבְּדֵל(19)wai'yav'deyl(20)between(21)193(22)בֵין(23)beyn(24)the~water(25)1162~s2(26)הַמַיִׁם(27)ha'ma'yim(28)which(29)2589(30)אֲשֶר(31)a'sher(32)from~under(33)2627(34)מִׁתַחַת(35)mi'ta'hhat(36)to~sheet(37)2118(38)לָּרָּקִׁיעַַ(39)la'ra'qi'a(40)and~between(41)193(42)וּבֵין(43)u'veyn(44)the~water(45)1162~s2(46)הַמַיִׁם(47)ha'ma'yim(48)which(49)2589(50)אֲשֶר(51)a'sher(52)from~upon(53)1616(54)מֵעַל(55)mey'al(56)to~sheet(57)2118(58)לָּרָּקִׁיעַַ(59)numwordsinverse(59)     1:7(0)and~he~will~do(v)(1)1686(2)וַיַעַשׂ(3)wai'ya'as(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)the~sheet(13)2118(14)הָּרָּקִׁיעַַ(15)ha'ra'qi'a(16)and~he~will~make~separate(v)(17)100(18)וַיַבְּדֵל(19)wai'yav'deyl(20)between(21)193(22)בֵין(23)beyn(24)the~water(25)1162~s2(26)הַמַיִׁם(27)ha'ma'yim(28)which(29)2589(30)אֲשֶר(31)a'sher(32)from~under(33)2627(34)מִׁתַחַת(35)mi'ta'hhat(36)to~sheet(37)2118(38)לָּרָּקִׁיעַַ(39)la'ra'qi'a(40)and~between(41)193(42)וּבֵין(43)u'veyn(44)the~water(45)1162~s2(46)הַמַיִׁם(47)ha'ma'yim(48)which(49)2589(50)אֲשֶר(51)a'sher(52)from~upon(53)1616(54)מֵעַל(55)mey'al(56)to~sheet(57)2118(58)לָּרָּקִׁיעַַ(59)la'ra'qi'a(60)and~he~will~exist(v)(61)505(62)וַיְּהִׁי(63)wai'hi(64)so(65)968(66)כֵן(67)kheyn2(68)numwordsinverse(68) ..............................     1:19(0)and~he~will~exist(v)(1)505(2)וַיְּהִׁי(3)wai'hi(4)evening(5)2724(6)עֶרֶב(7)e'rev(8)and~he~will~exist(v)(9)505(10)וַיְּהִׁי(11)wai'hi(12)morning(13)1861(14)בֹקֶר(15)vo'qer(16)day(17)898(18)יוֹם(19)yom(20)fourth(21)2214(22)רְּבִׁיעִׁי(23)rê'vi'i(24)numwordsinverse(24)     1:20(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)they(mp)~will~swarm(v)(9)2341(10)יִׁשְּרְּצוּ(11)yish're'tsu(12)the~water(13)1162~s2(14)הַמַיִׁם(15)ha'ma'yim(16)swarmer(17)2342(18)שֶרֶץ(19)she'rets(20)being(21)1902(22)נֶפֶש(23)ne'phesh(24)living(25)667(26)חַיָּה(27)numwordsinverse(27)     1:20(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)they(mp)~will~swarm(v)(9)2341(10)יִׁשְּרְּצוּ(11)yish're'tsu(12)the~water(13)1162~s2(14)הַמַיִׁם(15)ha'ma'yim(16)swarmer(17)2342(18)שֶרֶץ(19)she'rets(20)being(21)1902(22)נֶפֶש(23)ne'phesh(24)living(25)667(26)חַיָּה(27)hhai'yah(28)and~flyer(29)1701(30)וְּעוֹף(31)wê'oph(32)he~will~much~fly(v)(33)1700(34)יְּעוֹפֵף(35)yê'o'pheyph(36)upon(37)1616(38)עַל(39)al(40)the~land(41)2331(42)הָּאָרֶץ(43)numwordsinverse(43)     1:21(0)and~he~will~fatten(v)(1)232(2)וַיִׁבְּרָּא(3)wai'yiv'ra(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)the~crocodile(13)2654~s(14)הַתַנִׁינִׁם(15)ha'ta'ni'nim1(16)the~great(17)292~s(18)הַגְּדֹלִׁים(19)ha'ge'do'lim(20)and~at(21)85(22)וְּאֵת(23)wê'eyt(24)all(25)957(26)כָּל(27)kol(28)being(29)1902(30)נֶפֶש(31)ne'phesh(32)the~living(33)667(34)הַחַיָּה(35)ha'hha'yah(36)the~tread(v)(37)2312~ing(fs)(38)הָּרֹמֶשֶׂת(39)ha'ro'me'set(40)which(41)2589(42)אֲשֶר(43)a'sher(44)they(mp)~did~swarm(v)(45)2341(46)שָּרְּצוּ(47)shar'tsu(48)the~water(49)1162~s2(50)הַמַיִׁם(51)ha'ma'yim(52)to~kind(53)1216~them(mp)(54)לְּמִׁינֵהֶם(55)numwordsinverse(55)     1:21(0)and~he~will~fatten(v)(1)232(2)וַיִׁבְּרָּא(3)wai'yiv'ra(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)the~crocodile(13)2654~s(14)הַתַנִׁינִׁם(15)ha'ta'ni'nim1(16)the~great(17)292~s(18)הַגְּדֹלִׁים(19)ha'ge'do'lim(20)and~at(21)85(22)וְּאֵת(23)wê'eyt(24)all(25)957(26)כָּל(27)kol(28)being(29)1902(30)נֶפֶש(31)ne'phesh(32)the~living(33)667(34)הַחַיָּה(35)ha'hha'yah(36)the~tread(v)(37)2312~ing(fs)(38)הָּרֹמֶשֶׂת(39)ha'ro'me'set(40)which(41)2589(42)אֲשֶר(43)a'sher(44)they(mp)~did~swarm(v)(45)2341(46)שָּרְּצוּ(47)shar'tsu(48)the~water(49)1162~s2(50)הַמַיִׁם(51)ha'ma'yim(52)to~kind(53)1216~them(mp)(54)לְּמִׁינֵהֶם(55)lê'mi'ney'hem(56)and~at(57)85(58)וְּאֵת(59)wê'eyt(60)all(61)957(62)כָּל(63)kol(64)flyer(65)1701(66)עוֹף(67)oph(68)wing(69)984(70)כָּנָּף(71)ka'naph(72)to~kind(73)1216~him(74)לְּמִׁינֵהוּ(75)lê'mi'ney'hu(76)and~he~will~see(v)(77)2185(78)וַיַרְּא(79)wai'yar(80)elohiym(81)power~s(82)אֱלֹהִׁים(83)e'lo'him(84)given.that(85)940(86)כִׁי(87)ki(88)functional(89)848(90)טוֹב(91)tov(92)numwordsinverse(92)     1:22(0)and~he~will~much~kneel(v)(1)236(2)וַיְּבָּרֶךְ(3)wai'va'rekh(4)at(5)85~them(mp)(6)אֹתָּם(7)o'tam(8)elohiym(9)power~s(10)אֱלֹהִׁים(11)e'lo'him(12)to~>~say(v)(13)1187(14)לֵאמֹר(15)ley'mor(16)!(mp)~reproduce(v)(17)1858(18)פְּרוּ(19)pê'ru(20)and~!(mp)~increase(v)(21)2197(22)וּרְּבוּ(23)ur'vu(24)and~!(mp)~fill(v)(25)1192(26)וּמִׁלְּאוּ(27)u'mil'u(28)at(29)85(30)אֶת(31)et(32)the~water(33)1162~s2(34)הַמַיִׁם(35)ha'ma'yim(36)in~the~sea(37)895~s(38)בַיַמִׁים(39)ba'ya'mim(40)and~the~flyer(41)1701(42)וְּהָּעוֹף(43)wê'ha'oph(44)he~did~increase(v)(45)2197(46)יִׁרֶב(47)yi'rev(48)in~the~land(49)2331(50)בָּאָרֶץ(51)ba'a'rets(52)numwordsinverse(52)     1:24(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)she~will~make~go.out(v)(9)1922(10)תוֹצֵא(11)to'tsey(12)the~land(13)2331(14)הָּאָרֶץ(15)ha'a'rets(16)being(17)1902(18)נֶפֶש(19)ne'phesh(20)living(21)667(22)חַיָּה(23)hhai'yah(24)to~kind(25)1216~her(26)לְּמִׁינָּהּ(27)numwordsinverse(27)     1:24(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)she~will~make~go.out(v)(9)1922(10)תוֹצֵא(11)to'tsey(12)the~land(13)2331(14)הָּאָרֶץ(15)ha'a'rets(16)being(17)1902(18)נֶפֶש(19)ne'phesh(20)living(21)667(22)חַיָּה(23)hhai'yah(24)to~kind(25)1216~her(26)לְּמִׁינָּהּ(27)lê'mi'nah(28)beast(29)178(30)בְּהֵמָּה(31)bê'hey'mah(32)and~treader(33)2313(34)וָּרֶמֶשׂ(35)wa're'mes(36)and~living(37)667~him(38)וְּחַיְּתוַֹ(39)wê'hhai'to2(40)land(41)2331(42)אֶרֶץ(43)e'rets(44)to~kind(45)1216~her(46)לְּמִׁינָּהּ(47)lê'mi'nah(48)and~he~will~exist(v)(49)505(50)וַיְּהִׁי(51)wai'hi(52)so(53)968(54)כֵן(55)kheyn3(56)numwordsinverse(56)     1:25(0)and~he~will~do(v)(1)1686(2)וַיַעַשׂ(3)wai'ya'as(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)at(9)85(10)אֶת(11)et(12)living(13)667(14)חַיַת(15)hhai'yat(16)the~land(17)2331(18)הָּאָרֶץ(19)ha'a'rets(20)to~kind(21)1216~her(22)לְּמִׁינָּהּ(23)lê'mi'nah(24)and~at(25)85(26)וְּאֶת(27)wê'et(28)the~beast(29)178(30)הַבְּהֵמָּה(31)ha'be'hey'mah(32)to~kind(33)1216~her(34)לְּמִׁינָּהּ(35)lê'mi'nah(36)and~at(37)85(38)וְּאֵת(39)wê'eyt(40)all(41)957(42)כָּל(43)kol(44)treader(45)2313(46)רֶמֶשׂ(47)re'mes(48)the~ground(49)425(50)הָּאֲדָּמָּה(51)ha'a'da'mah(52)to~kind(53)1216~him(54)לְּמִׁינֵהוּ(55)lê'mi'ney'hu(56)and~he~will~see(v)(57)2185(58)וַיַרְּא(59)wai'yar(60)elohiym(61)power~s(62)אֱלֹהִׁים(63)e'lo'him(64)given.that(65)940(66)כִׁי(67)ki(68)functional(69)848(70)טוֹב(71)tov(72)numwordsinverse(72)     1:26(0)and~he~will~say(v)(1)1187(2)וַיֹאמֶר(3)wai'yo'mer(4)elohiym(5)power~s(6)אֱלֹהִׁים(7)e'lo'him(8)we(cp)~will~do(v)(9)1686(10)נַעֲשֶׂה(11)na'a'seh(12)human(13)424(14)אָדָּם(15)a'dam(16)in~image(17)1971~us(cp)(18)בְּצַלְּמֵנוּ(19)bê'tsal'mey'nu(20)like~likeness(21)431~us(cp)(22)כִׁדְּמוּתֵנוּ(23)kid'mu'tey'nu(24)and~he~did~rule(v)(25)2235(26)וְּיִׁרְּדוּ(27)wê'yir'du(28)in~fish(29)395(30)בִׁדְּגַת(31)vid'gat(32)the~sea(33)895(34)הַיָּם(35)hai'yam(36)and~in~flyer(37)1701(38)וּבְּעוֹף(39)uv'oph(40)the~sky(41)2512~s2(42)הַשָּמַיִׁם(43)ha'sha'ma'yim(44)and~in~the~beast(45)178(46)וּבַבְּהֵמָּה(47)u'va'be'hey'mah(48)and~in~all(49)957(50)וּבְּכָּל(51)numwordsinverse(51) 

here terminal output debug data, in case helps

    1:1  in~summit(0)  1:2  and~the~land(1)  or[nextglitch][index:2] 1:3  and~he~will~say(v)(2)  1:4  and~he~will~see(v)(3)  yom[nextglitch][index:4] 1:5  and~he~will~call.out(v)(4)  vo'qer[curglitch][index:5] 1:5  and~he~will~call.out(v)(5)  u'veyn[nextglitch][index:6] 1:7  and~he~will~do(v)(6)  la'ra'qi'a[curglitch][index:7] 1:7  and~he~will~do(v)(7)  wai'hi[curglitch][index:8] 1:8  and~he~will~call.out(v)(8)  yi'qaw'u[cur&nextglitch][index:9] 1:9  and~he~will~say(v)(9)  lai'ya'ba'shah[nextglitch][index:10] 1:10  and~he~will~call.out(v)(10)  e'lo'him[cur&nextglitch][index:11] 2[nextglitch][index:11] bad data 3[cur&nextglitch][index:12] ©[nextglitch][index:12] bad data tad'shey[nextglitch][index:13] 1:11  and~he~will~say(v)(13)  maz'ri'a[cur&nextglitch][index:14] 1:11  and~he~will~say(v)(14)  lê'mi'ney'hu[nextglitch][index:15] 1:12  and~she~will~make~go.out(v)(15)  1:13  and~he~will~exist(v)(16)  u'veyn[nextglitch][index:17] 1:14  and~he~will~say(v)(17)  wê'sha'nim[curglitch][index:18] 1:14  and~he~will~say(v)(18)  ha'a'rets[curglitch][index:19] 1:15  and~they(cp)~did~exist(v)(19)  ha'ma'or[cur&nextglitch][index:20] 1:16  and~he~will~do(v)(20)  al[nextglitch][index:21] 1:17  and~he~will~give(v)(21)  e'lo'him[nextglitch][index:22] 1:18  and~to~>~regulate(v)(22)  1[cur&nextglitch][index:23] 3[nextglitch][index:23] bad data 4[cur&nextglitch][index:24] ©[nextglitch][index:24] bad data 1:19  and~he~will~exist(v)(25)  yish're'tsu[nextglitch][index:26] 1:20  and~he~will~say(v)(26)  hhai'yah[cur&nextglitch][index:27] 1:20  and~he~will~say(v)(27)  ne'phesh[nextglitch][index:28] 1:21  and~he~will~fatten(v)(28)  lê'mi'ney'hem[curglitch][index:29] 1:21  and~he~will~fatten(v)(29)  ba'ya'mim[curglitch][index:30] 1:22  and~he~will~much~kneel(v)(30)  to'tsey[nextglitch][index:31] 1:24  and~he~will~say(v)(31)  lê'mi'nah[curglitch][index:32] 1:24  and~he~will~say(v)(32)  ha'be'hey'mah[curglitch][index:33] 1:25  and~he~will~do(v)(33)  uv'oph[cur&nextglitch][index:34] 1:26  and~he~will~say(v)(34)  ha'a'dam[nextglitch][index:35] 1:27  and~he~will~fatten(v)(35)  1[cur&nextglitch][index:36] 3[nextglitch][index:36] bad data the[cur&nextglitch][index:37] he~did~fatten(v)[nextglitch][index:37] bad data et[nextglitch][index:38] 1:28  and~he~will~much~kneel(v)(38)  ur'du[cur&nextglitch][index:39] 1:28  and~he~will~much~kneel(v)(39)  1:29  and~he~will~say(v)(40)  ro'meys[nextglitch][index:41] 1:30  and~to~all(41)  lê'akh'lah[curglitch][index:42] 1:30  and~to~all(42)  a'sher[cur&nextglitch][index:43] 1:31  and~he~will~see(v)(43) 

i'm guessing code iterating , modifing list @ same time, give unexpected results. use 2 lists, 1 data read file , 1 new data. have @ unrelated example:

>>> l = range(10) >>> l [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> in l: ...   print(i) ...   x = l.pop() ...  0 1 2 3 4 

i have couple of things add:

use with keyword open , close file (both reading , writing):

lines_list = none open('<your_file>') handler:  # take care of closing file     lines_list = handler.read().splitlines() 

know when use parenthesis, this:

if ( (word_list[0].isdigit() < 8) , (':' not in word_list[0]) ) , concatenatenext_string_tf( index, lines_list): 

is same as:

if word_list[0].isdigit() < 8 , ':' not in word_list[0] , concatenatenext_string_tf(index, lines_list): 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -