我一直在xcode和vi上收到这个错误。 Python说行类LeastModel有一个IndentationError:期望一个缩进块。 我在Xcode上检查了我的偏好设置,使用4个空格作为制表符,并且在任何地方使用了制表符。请帮帮我!Python IndentationError:Xcode上的“预期缩进块”
def make_model(data,model):
class LeastModel():
"""
linear system solved using linear least squares
This class serves as an example that fulfills the model interface needed by the ransa function.
"""
def __init__(self,input_columns,output_columns):
self.input_columns = input_columns
self.output_columns = output_columns
#self.debug = debug
如果问题真的出现在您所说的“LeastModel类”行中,那么问题必须出现在更早的行上(例如,是否有一个“if x:”行)? – 2013-02-19 20:17:27