Exemplo n.º 1
0
from twisted.internet import reactor
from twisted.internet.task import cooperate, LoopingCall

from turtles import setup_window, TurtleContext, Dispatcher

if __name__ == "__main__":
    canvas = setup_window("Logo140 - Leeds Hack 2012")

    #create some demo turtles
    tc1 = TurtleContext(canvas)
    tc2 = TurtleContext(canvas)
    tc3 = TurtleContext(canvas)
    tc4 = TurtleContext(canvas)
    tc5 = TurtleContext(canvas)
    

    tc6 = TurtleContext(canvas)
    tc7 = TurtleContext(canvas)
    tc8 = TurtleContext(canvas)
    tc9 = TurtleContext(canvas)
    tc10 = TurtleContext(canvas)
    
    tc1.parse('setpc blue')
    tc2.parse('setpc red')
    tc3.parse(u'setpc green')
    tc4.parse('setpc orange')
    tc5.parse('setpc purple')
    tc6.parse('setpc blue')
    tc7.parse('setpc red')
    tc8.parse('setpc green')
    tc9.parse('setpc orange')
Exemplo n.º 2
0
from twisted.internet import reactor
from twisted.internet.task import cooperate, LoopingCall

from turtles import setup_window, draw_headings, TurtleContext, Dispatcher

if __name__ == "__main__":
    canvas = setup_window("Logo140, Collaborative Art Installation - Leeds Hack 2012")

    
    dispatcher = Dispatcher(canvas=canvas)
    l = LoopingCall(dispatcher.dispatcher)
    l.start(5.0)        

    reactor.run()  #no need for tk mainloop