关于我遇到的此错误,我需要您的帮助...
这里是我的源代码:
# A tibble: 10 x 7
name x rank_01 y rank_02 z rank_03
* <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 A 9.37 8 11.5 4 10.9 2
2 B 10.2 6 10.4 5 10.8 3
3 C 9.16 10 9.38 10 10.1 9
4 D 11.6 1 7.79 8 8.01 10
5 E 10.3 5 11.1 2 10.6 1
6 F 9.18 9 9.96 9 9.94 8
7 G 10.5 4 9.98 6 9.84 6
8 H 10.7 2 10.9 1 8.53 7
9 I 10.6 3 10.8 3 9.52 4
10 J 9.69 7 10.6 7 10.4 5
错误在这里:
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
class RootWidget(BoxLayout):
def __init__(self, **kwargs):
super(RootWidget, self).__init__(**kwargs)
self.add_widget(Button(text='Button 1'))
cb = CustomBtn()
cb.bind(pressed=self.btn_pressed)
self.add_widget(cb)
self.add_widget(Button(text='Button 2'))
def btn_pressed(self, instance, pos):
print("Pos: printed from root widget: {pos}".format(pos=pos))
class CustomBtn(Widget):
pressed = ListProperty([0,0])
def on_touch_down(self, touch):
if self.collide_point(*touch.pos):
self.pressed = touch.pos
return True
return super(CustomBtn, self).on_touch_down(touch)
def on_pressed(self, instance, pos):
print("Pressed at {pos}".format(pos=pos))
class TestApp(App):
def build(self):
return RootWidget()
if __name__ == "__main__":
TestApp().run()
我正在使用Dell Latitude E4310,Windows 10,Corei5