在以下代码中做什么?

时间:2014-07-12 00:05:27

标签: python-2.7

我想开始使用Pyglet开始用Python创建一些GUI界面,使用我迄今为止学到的东西。我不是专家,事实上我可能知道这很危险。在查看文档时,我了解到目前为止所有内容,除了....

鼠标事件的处理方式类似:

from pyglet.window import mouse

@window.event
def on_mouse_press(x, y, button, modifiers):
    if button == mouse.LEFT:
        print 'The left mouse button was pressed.'

@ window.event到底具体是做什么的。我以前写过事件处理程序,所以我理解这个概念,但我不知所措。基于一些搜索,无论是在这里还是谷歌,我认为它是某种类型的装饰,但我只是不确定。

提前致谢。

杰森

0 个答案:

没有答案