第4行我有一个缩进的块错误:
from SimPy.Simulation import *
from random import uniform
class Car(Process):
def init(self,id):
Process.init(self)
self.id=id
def carDriving(self,driveTime):
...
可能是什么造成的?
答案 0 :(得分:4)
你必须缩进类和函数:
from SimPy.Simulation import *
from random import uniform
class Car(Process):
def __init__(self, id):
Process.init(self)
self.id = id
def carDriving(self, driveTime):
# do something here
pass