Auto汽车工程师的博客我想本想sleep下,然后报错了 AttributeError: ‘str’ object has no attribute ‘sleep’ 解决方案: 方案一: 将from time import换成import time 方案二: 检查是否有定义名称为time的变量,如有换位其他名称,...
煦梦旖溪的博客报错:AttributeError: ‘int’ object has no attribute ‘sleep’ 修改前代码: import time # 睡眠时间 def sleeptime(time): # 时间间隔time秒 print("休息",end="") for i in range(time): time.sleep(1) ...