2014-10-02 85 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

你混合制表符和空格。