AttributeError: 'NoneType' object has no attribute 'items'

AttributeError: 'NoneType' object has no attribute 'items'

img

这是什么问题,一直解决不了

NoneType”对象没有属性“items” 你代码里用到 NoneType.items 了吗 ? 可能是 你调用的元素不存在

https://blog.csdn.net/qq_39220334/article/details/122887031

说明layout变量赋值不正确,是个None,但是你把它当个字典在使用

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^