Apr-20-2020, 04:55 AM
Your are having problems with Python because you don't know Python. I couldn't write anything in Perl. That language is crazy hard.
No, moving the if statement up did not change your program. What changed your program is you moved the print statement so it prints if runtime_l in ln. Before it used to print if program_n in line
No, moving the if statement up did not change your program. What changed your program is you moved the print statement so it prints if runtime_l in ln. Before it used to print if program_n in line
if runtime_l in ln: #print (ln) *extraWords,rnt_1 = ln.split('Time') # Grtting Run Time line # rnt_1=rnt_1.replace('"','') ftow.write (st_t1 +endt1 + rnt_1 + prg_n + '\n') # works here# print ("All Lines -->> "+st_t1 +endt1 + rnt_1 + prg_n + '\n') # does not work here #Code blocks in python are specified by indentation. The print statement above is only executed if runtime_l in n. If you want it to print for each line you need to un-indent the print statement 1 level.