Custom Search

Thursday, March 5, 2015

How to Install Python SimpleGUI SimpleGUICS2Pygame for your CodeSkulptor Programs

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!

2 comments:

  1. The complete documentation:
    http://simpleguics2pygame.readthedocs.org/

    Installation:
    http://simpleguics2pygame.readthedocs.org/en/latest/#installation

    ReplyDelete
  2. How to install pygame
    ----------------------
    ###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"

    ReplyDelete