我一直在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