【发布时间】:2012-07-04 21:33:36
【问题描述】:
可能重复:
IndentationError: unindent does not match any outer indentation level
我有以下 python 代码。
import sys
ins = open( sys.argv[1], "r" )
array = []
for line in ins:
s = line.split()
array.append( s[0] ) # <-- Error here
print array
ins.close()
python解释器报错
File "sort.py", line 7
array.append( s[0] )
^
IndentationError: unindent does not match any outer indentation level
为什么会这样?以及如何纠正这个错误?
【问题讨论】:
-
PEP-8 建议不要写像
foo( x, y )这样的函数参数。 -
用
python -tt运行你的脚本
标签: python