2014-10-02 98 views
0
counter = 0 

with open("vejman_admdata.gml") as infile: 
    for line in infile: 
     print(line) 
     counter += 1 
     if counter == 300: 
      break 

我得到以下信息:Python:這個標識有什麼問題?

E:\01_projekter\Utils\vejman>test.py >log.txt 
    File "E:\01_projekter\Utils\vejman\test.py", line 7 
    counter += 1 
    ^
IndentationError: unexpected indent 
+3

你在混合製表符和空格嗎? – Maroun 2014-10-02 09:54:27

+1

也許你在混合標籤和空格 – klashxx 2014-10-02 09:54:32

+0

你在混合標籤和空格,我去編輯你的代碼,如果你通過縮進在每一行上移動光標,你可以看到光標跳轉 – EdChum 2014-10-02 09:55:10

回答

1

嘗試編輯你的問題:

enter image description here

你混合製表符和空格。