Python Forum
It looks like an error but maybe not
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
It looks like an error but maybe not
#3
Sure.
I'm trying to pull out two lines after a matched line, I'm splitting both lines and will extract elements from each line and print it it to a different file.
I have no errors after the first:
ln_f = next (each_dirf)
but after the second:
ln_f = next (each_dirf)
errors starts.

Here is a bloc I have the problem with.
I have next two bloks like this one and both producing the same error. rest of the "IF" blocks having NO problems.

                    if 'type="HDDD' in ln_f :                                                            
                        ln_f = next (each_dirf)
                        
                        ln_f = ln_f.lstrip()
                        ln_f = ln_f.replace("=", " ").replace('"','')
                        mm11 = ln_f.split(" ")                         
                        w1 = slot_number+","+mm11[8]+","+mm11[10]+","+mm11[12]+","+mm11[14]+","+mm11[18]+" "+mm11[19]
                        
                        XML_Lines_Out.write(w+w1+'\n')

                        ln_f = next (each_dirf)                                         
                        ln_f = ln_f.lstrip()
                        print (">>>>> ", ln_f)  
Reply


Messages In This Thread
It looks like an error but maybe not - by tester_V - Aug-31-2020, 03:40 AM
RE: It looks like an error but maybe not - by buran - Aug-31-2020, 03:45 AM
RE: It looks like an error but maybe not - by tester_V - Aug-31-2020, 04:06 AM
RE: It looks like an error but maybe not - by buran - Aug-31-2020, 04:39 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020