Python Forum
unindent does not match any outer indentation level
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unindent does not match any outer indentation level
#1
Hi

Please help

Thank you

iam getting
unindent does not match any outer indentation level

this is my code
for fname in os.listdir("."): 
    if "ETV" in fname:
        with open(fname) as csvfile:
             spamreader = csv.reader(csvfile, delimiter='/')
             for row in spamreader:  # for loop
                #print row[7]
                if row[2].startswith("PIN") and row[7] == 'E':
                    reg_pin_e += 1
                    reg_pin_page_e += int(row[9])
                if row[2].startswith("PIN") and row[7] == 'B':
                    reg_pin_b += 1
                    reg_pin_page_b += int(row[9])
                if row[2].startswith("PIN") and row[7] == 'W':
                    reg_pin_w += 1
                    reg_pin_page_w += int(row[9])
                if row[2].startswith("PIN") and row[7] == 'N':
                    reg_pin_n += 1
                    reg_pin_page_n += int(row[9]) 
 [b]print("Total Pin-E Count  --> "  +  str(reg_pin_e))[/b]
 print("total Pin-E Pages  --> "  +  str(reg_pin_page_e)) 
 print("Total Pin-N Count  --> "  +  str(reg_pin_n))
 print("total Pin-N Pages  --> "  +  str(reg_pin_page_n)) 
 print("Total Pin-W Count  --> "  +  str(reg_pin_w))
 print("total Pin-W Pages  --> "  +  str(reg_pin_page_w)) 
 print("Total Pin-B Count  --> "  +  str(reg_pin_b))
 print("total Pin-B Pages  --> "  +  str(reg_pin_page_b)) 
this is line give me issue

print("Total Pin-E Count  --> "  +  str(reg_pin_e))
Reply
#2
I don't see any indentation. Please, put your code between code tags to preserve the indentation in the post!
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
Just like the error says, the print statements are not properly indented!
Reply
#4
Than you All

i found the error it was not with open(fname) as csvfile:

Thank you
Reply
#5
Quote:it was not with open(fname) as csvfile
did someone say it was?
your error was clearly indentation
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas Outer merge skollu826 2 168 Apr-20-2024, 06:28 PM
Last Post: deanhystad
  can Inner Class reference the Outer Class's static variable? raykuan 6 5,912 Jul-01-2022, 06:34 AM
Last Post: SharonDutton
  Level curves don't match after rotation schniefen 1 1,536 Dec-14-2020, 09:56 PM
Last Post: schniefen
  Unindent does not match any outer intendation level -error MaartenRo 3 2,277 Jun-28-2020, 11:46 AM
Last Post: MaartenRo
  HELP! unindent does not match any outer indentation level blackjesus24 2 1,958 Jan-29-2020, 08:00 AM
Last Post: blackjesus24
  unindent does not match any outer indentation level , How can i fix it the_fire_pharaoh 2 2,519 Jan-01-2019, 10:52 AM
Last Post: the_fire_pharaoh
  Outer loop not running ted_gress 2 3,338 Aug-25-2018, 07:56 AM
Last Post: volcano63

Forum Jump:

User Panel Messages

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