Python中文
首页
教程
问答
标签
搜索
登录
注册
Kivy AttributeError:“super”对象没有带有ScreenManag的属性''
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我试图将方法绑定到微调器的文本值。它需要在显示TestScreen之前绑定。如果我不使用屏幕管理器(例如如果测试应用程序构建返回TestScreen而不是TestScreenManager)。什么时候测试应用程序构建返回TestScreenManager当我引用自我.ids在<code>TestScreen.__init__</code></p> <pre><code>AttributeError: 'super' object has no attribute '__getattr__' </code></pre> <p>在测试.py在</p> ^{pr2}$ <p>在试验电压在</p> <pre><code><TestScreen>: name: "World Screen" BoxLayout: orientation: 'vertical' Label: text: "Name" font_size: 30 BoxLayout: Label: text: "Active Selection" size_hint_x: .5 Spinner: id: test_spinner text: "Value1" values: ["Value1", "Value2"] Button: text: "Print spinner value" on_press: root.print_spinner_value() <TestScreenManager>: TestScreen: </code></pre> <p>我已经尝试在on_enter方法中绑定该方法,但是我得到了相同的错误。然而,自我.ids如果我注释掉自我.ids初始化函数中的语句。在</p> <p>目前,每次按下微调器时,我都可以通过绑定函数来找到解决方法。但这似乎不是解决问题的最佳方法</p> <pre><code>on_press: self.bind(text=root.on_spinner_select) </code></pre> <p>所以我的问题是:在使用ScreenManager时,如何在加载时将方法绑定到微调器?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>尝试使用<code>__init__(self, *args, **kwargs)</code>。 使用**kwargs只假设输入总是某种关键字参数(例如dicts)。这几乎就是错误的意思,因为它试图从您传递的参数中获取所有属性。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
4 回答
无法使用Django\u mssql\u后端迁移到外部hos
10 回答
无法使用Django&Python3.4连接到MySql
9 回答
无法使用Django+nginx上载媒体文件
7 回答
无法使用Django1.6导入名称模式
3 回答
无法使用Django1.7和mongodb登录管理站点
6 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
3 回答
无法使用Djangockedi验证CBV中的字段
1 回答
无法使用Djangocketditor上载图像(错误400)
5 回答
无法使用Djangocron进行函数调用
6 回答
无法使用Djangofiler djang上载文件
9 回答
无法使用Djangokronos
6 回答
无法使用Djangomssql provid
10 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
3 回答
无法使用Djangomssq迁移Django数据库
3 回答
无法使用Djangonox创建用户
8 回答
无法使用Djangopyodb从Django查询SQL Server
9 回答
无法使用Djangopython3ldap连接到ldap
10 回答
无法使用Djangoredis连接到redis
3 回答
无法使用Django中的FK创建新表
7 回答