-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range #18
Comments
有时候countdown_time_units长度会超过4,加一个if index == 4: break,暂时用着,不过偶尔还是会报其他错闪退 |
主要问题是有时候刷新页面没有返回倒计时,楼上老哥的方式可以解决,但可以考虑再来刷一下页面。。。 |
请问加载哪里 |
@wwccz1 加在countdown_all_times.append(countdown_time_units[index])前面或者直接注释掉countdown_all_times.append(countdown_time_units[index])也行 |
2023-09-23 18:02:33.486463 距离抢购开始还剩:00 天 00 时 05 分 28 秒
2023-09-23 18:02:34.549085 距离抢购开始还剩:00 天 00 时 05 分 27 秒
2023-09-23 18:02:35.616211 距离抢购开始还剩:00 天 00 时 05 分 26 秒
2023-09-23 18:02:37.916294 开始选择手机规格
2023-09-23 18:02:38.595376 选择手机规格完成,颜色:白沙银 版本:12GB+512GB
Traceback (most recent call last):
File "C:\Users\mmm\Desktop\hw_seckill\main.py", line 14, in
main()
File "C:\Users\mmm\Desktop\hw_seckill\main.py", line 9, in main
huawei.start_process()
File "C:\Users\mmm\Desktop\hw_seckill\huawei.py", line 38, in start_process
self.__countdown()
File "C:\Users\mmm\Desktop\hw_seckill\huawei.py", line 98, in __countdown
print("{0} 距离抢购开始还剩:{1}".format(datetime.now(), self.__format_countdown_time(countdown_times)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mmm\Desktop\hw_seckill\huawei.py", line 150, in __format_countdown_time
countdown_all_times.append(countdown_time_units[index])
~~~~~~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of range
运行中突然报上面的错,然后就结束了,这个什么原因啊
The text was updated successfully, but these errors were encountered: