Python Forum

Full Version: unindent does not match any outer indentation level
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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))
I don't see any indentation. Please, put your code between code tags to preserve the indentation in the post!
Just like the error says, the print statements are not properly indented!
Than you All

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

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