Python中文
首页
教程
问答
标签
搜索
登录
注册
Kivy返回空白屏幕
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>所以我在看<a href="https://www.youtube.com/watch?v=6yMHHC36tT0" rel="nofollow noreferrer">this</a>视频,我跟他一样跟着他,我像他一样写代码,但当我运行时,它不会出错,而是返回一个空白屏幕而不是计算器UI,另一个视频也发生了同样的事情。。(P.S我的kivy版本是1.10.1)</p> <pre><code>[INFO ] [Logger ] Record log in C:\Users\Erfan\.kivy\logs\kivy_19-01- 01_23.txt [INFO ] [Kivy ] v1.10.1 [INFO ] [Python ] v3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] [INFO ] [Factory ] 194 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored) [INFO ] [Text ] Provider: sdl2 [INFO ] [Window ] Provider: sdl2 [INFO ] [GL ] Using the "OpenGL" graphics system [INFO ] [GL ] GLEW initialization succeeded [INFO ] [GL ] Backend used <glew> [INFO ] [GL ] OpenGL version <b'4.5.0 NVIDIA 353.62'> [INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'> [INFO ] [GL ] OpenGL renderer <b'GeForce GT 730/PCIe/SSE2'> [INFO ] [GL ] OpenGL parsed version: 4, 5 [INFO ] [GL ] Shading version <b'4.50 NVIDIA'> [INFO ] [GL ] Texture max size <16384> [INFO ] [GL ] Texture max units <32> [INFO ] [Window ] auto add sdl2 input provider [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked [INFO ] [Base ] Start application main loop [INFO ] [Base ] Leaving application in progress... </code></pre> <p>这是我的代码,没有错误。你知道吗</p> <pre><code>import kivy from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.button import Label from kivy.uix.widget import Widget kivy.require("1.10.1") class CalcGridLayout(GridLayout): pass class CalculatorApp(App): def LoginForm(self): return CalcGridLayout calcApp = CalculatorApp() calcApp.run() </code></pre> <p>它重定向到我创建的一个名为“的文件”计算器.kv" 这些是文件中的代码。你知道吗</p> <pre><code><CustButton@Button>: font_size: 32 <CalcGridLayout>: id: calculator display: entry rows: 5 padding: 10 spacing: 10 BoxLayout: TextInput: id: entry font_size: 32 multiline: False BoxLayout: spacing: 10 CustButton: text: "7" on_press: entry.text += self.text CustButton: text: "8" on_press: entry.text += self.text CustButton: text: "9" on_press: entry.text += self.text CustButton: text: "+" on_press: entry.text += self.text BoxLayout: spacing: 10 CustButton: text: "4" on_press: entry.text += self.text CustButton: text: "5" on_press: entry.text += self.text CustButton: text: "6" on_press: entry.text += self.text CustButton: text: "-" on_press: entry.text += self.text BoxLayout: spacing: 10 CustButton: text: "1" on_press: entry.text += self.text CustButton: text: "2" on_press: entry.text += self.text CustButton: text: "3" on_press: entry.text += self.text CustButton: text: "*" on_press: entry.text += self.text BoxLayout: spacing: 10 CustButton: text: "AC" on_press: entry.text = "" CustButton: text: "0" on_press: entry.text += self.text CustButton: text: "=" on_press: entry.text += self.text CustButton: text: "/" on_press: entry.text += self.text </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>是的!我发现了这个问题,问题是我可能使用了LoginForm,这与我们需要的完全不同,所以我基本上需要做的是改变LoginForm来构建。你知道吗</p> <p>我是说从</p> <pre><code>def LoginForm(self): </code></pre> <p>至</p> <pre><code>def build(self): </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何在Excel中读取公式并将其转换为Python中的计算?
9 回答
如何在excel中读取嵌入的excel,并将嵌入文件中的信息存储在主excel文件中?
7 回答
如何在Excel中返回未知列长度的非空顶行列值?
3 回答
如何在excel中选择数据列?
5 回答
如何在Excel中通过脚本自动为一列中的所有单元格创建公共别名
3 回答
如何在excel中高效格式化范围AttributeError:“tuple”对象没有属性“fill”
5 回答
如何在excel单元格中编写python函数
2 回答
如何在excel单元格中自动执行此python代码?
7 回答
如何在excel工作表中创建具有相应值的新列
3 回答
如何在Excel工作表中复制条件为单元格颜色的python数据框?
10 回答
如何在Excel工作表中循环
8 回答
如何在excel工作表中打印嵌套词典?
1 回答
如何在excel工作表中绘制所有类的继承树?
10 回答
如何在Excel工作表中自动调整列宽?
1 回答
如何在excel工作表中追加并进一步处理
9 回答
如何在excel工作表之间进行更改?
4 回答
如何在excel或csv上获取selenium数据?
7 回答
如何在Excel或Python中将正确的值赋给正确的列
8 回答
如何在excel或python中提取单词周围的文本?
10 回答
如何在excel或python中转换来自Jira的3w 1d 4h的fromat数据?
5 回答