【问题标题】:QPython error: 'Needs more than one value to unpack'QPython 错误:“需要多个值才能解压”
【发布时间】:2015-02-23 02:12:05
【问题描述】:

我开始使用 Qpython 和 kivy 在我的 Android 上编程。 但是每次我运行这段代码时,它都会告诉我我需要多个值来解压。我做错了什么? 代码如下:

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse, Line


class MyPaintWidget(Widget):

    def on_touch_down(self, touch):
        with self.canvas:
            Color(1, 1, 0)
            d = 30.
            Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
            touch.ud['line'] = Line(points=(touch.x, touch.y))

    def on_touch_move(self, touch):
        touch.ud['line'].points += [touch.x, touch.y]


class MyPaintApp(App):

    def build(self):
        return MyPaintWidget()


if __name__ == '__main__':
    MyPaintApp().run()

【问题讨论】:

    标签: android unpack qpython


    【解决方案1】:

    我可以在最新版本的qpython(1.0.4)上很好地运行它

    我在脚本中插入了“#qpy:kivy”,让它以kivy模式运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 2013-04-04
      • 2011-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多