1)
Install
#pip install SimpleGUICS2Pygame
2)
#python
>>> import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
>>>
>>> #Event handler
... def tick():
... print "tick!"
...
>>> #Register handler
... timer = simplegui.create_timer(1000,tick)
>>>
>>>
>>> #Start timer
... timer.start()
>>> tick!
tick!
tick!
tick!
tick!
tick!
Install
#pip install SimpleGUICS2Pygame
2)
#python
>>> import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
>>>
>>> #Event handler
... def tick():
... print "tick!"
...
>>> #Register handler
... timer = simplegui.create_timer(1000,tick)
>>>
>>>
>>> #Start timer
... timer.start()
>>> tick!
tick!
tick!
tick!
tick!
tick!
The complete documentation:
ReplyDeletehttp://simpleguics2pygame.readthedocs.org/
Installation:
http://simpleguics2pygame.readthedocs.org/en/latest/#installation
How to install pygame
ReplyDelete----------------------
###Install dependencies###
#sudo apt-get update --fix-missing
#sudo apt-get build-dep python-pygame
#sudo apt-get install mercurial
###Create virtualenv###
#virtualenv venv
#source venv/bin/activate
###Clone and Install pygame###
#hg clone https://bitbucket.org/pygame/pygame
#cd pygame
#sudo python setup.py install
###Test###
#python -c "import pygame"