开发者

Python PyMT script crashing on open

I am attempting to learn the PyMT library and am trying to implement a simple program that i found on the web. however every time i open the script in PyMT it crashes as soon as it opens is there any thing that is incorrect in my code that would be cause it to be crashing?

from pymt import *

class Tracer(MTWidget):

def init(self):
开发者_运维知识库    self.lines = []

def on_touch_down(self, touch):

    touch.userdata['line'] = list(touch.pos)
    self.lines.append (touch.userdata['line'])

def on_touch_move(self, touch):
    touch.userdata['line'].extend(touch.pos)

def draw(self) :
    for touch in getAvailableTouchs():
        drawLine(line)


w = MTWindow()

canvas = MTScatterPlane()
canvas.add_widget(Tracer())

w.add_widget(canvas)
runTouchApp()


SO apparently if you are importing the .py file which is what PyMT does you can't create the ui....does anyone know how i would go about setting up a UI then?


I've installed pymt in my mac, and I couldn't run the examples using python command. I've foolwed the instructions on README, and ran the examples using pymt command.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜