我正在尝试从用户那里获得输入,直到他按下ctrl-c。然而,我无法抓住 error,我认为它与sklearn有关(我为其余的代码导入了它)
这是代码:
b = @(theta) y.*cos(theta)./((x-R.*cos(theta)).^2+y.^2+(z - ...
R.*sin(theta)).^2).^(3/2);
integral(b,1,2)
ans =
0.055781612354862
答案 0 :(得分:1)
修改缩进,如下所示:
try:
while(True):
i+=1
put = input("\tEnter name of feature number " + str(i) +":\t")
features.append(put)
except KeyboardInterrupt:
print("\n\tFeatures Added!")
sleep(SLEEP)
return None
except:
exit("\nError has occurred, please come back later...")