Python中文
首页
教程
问答
标签
搜索
登录
注册
Kivy MDDatePicker TypeError:\uuuu init\uuuu()缺少1个必需的位置参数:“回调”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p><a href="https://kivymd.readthedocs.io/en/latest/components/pickers/index.html#mddatepicker" rel="nofollow noreferrer">https://kivymd.readthedocs.io/en/latest/components/pickers/index.html#mddatepicker</a></p> <p>这段代码来自官方演示页面,所以可能是Github的问题</p> <p><em>小部件正在测试中。因此,如果您能告诉我们发现的错误,我们将不胜感激</em></p> <pre><code>from kivy.lang import Builder from kivymd.app import MDApp from kivymd.uix.picker import MDDatePicker KV = ''' MDFloatLayout: MDToolbar: title: "MDDatePicker" pos_hint: {"top": 1} elevation: 10 MDRaisedButton: text: "Open time picker" pos_hint: {'center_x': .5, 'center_y': .5} on_release: app.show_date_picker() ''' class Test(MDApp): def build(self): return Builder.load_string(KV) def on_save(self, instance, value, date_range): ''' Events called when the "OK" dialog box button is clicked. :type instance: <kivymd.uix.picker.MDDatePicker object>; :param value: selected date; :type value: <class 'datetime.date'>; :param date_range: list of 'datetime.date' objects in the selected range; :type date_range: <class 'list'>; ''' print(instance, value, date_range) def on_cancel(self, instance, value): '''Events called when the "CANCEL" dialog box button is clicked.''' def show_date_picker(self): date_dialog = MDDatePicker() date_dialog.bind(on_save=self.on_save, on_cancel=self.on_cancel) date_dialog.open() Test().run() </code></pre> <p><code>TypeError: __init__() missing 1 required positional argument: 'callback'</code></p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>MDDatePicker不能与<code>kivymd-0.104.1</code>一起使用。您必须安装<code>kivymd-0.104.2.dev0</code>,它才能正常工作</p> <pre><code>pip uninstall kivymd pip install https://github.com/kivymd/KivyMD/archive/master.zip </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何用if条件捕获函数返回值
2 回答
如何用if语句判断列表中是否存在该索引?
3 回答
如何用if语句向量化numpy数组中的最大值?
1 回答
如何用IF语句有条件地保存零碎的结果?
9 回答
如何用if语句测试异常对象?
5 回答
如何用IF语句编写二元函数
7 回答
如何用igraph在python中创建顶点权重的图?
10 回答
如何用ijson和python解析json
9 回答
如何用iloc求子矩阵
2 回答
如何用Imagemagick或PIL绘制高质量的图像笔划(边框)?
9 回答
如何用importlib在python中动态导入模块?
4 回答
如何用import语句重写python内置函数?
3 回答
如何用imshow混合裁剪的强度并显示正确的混合强度?
7 回答
如何用in dictionary解析havin dictionary中的json文件
8 回答
如何用in-Django URL替换%20
9 回答
如何用in\op正确构造查询
4 回答
如何用inbuild对象替换文件
3 回答
如何用inheritan类实现flask restful
2 回答
如何用intersphinx正确地编写对外部文档的交叉引用?
3 回答
如何用int修改LpVariable?
10 回答