SimpleGUICS2Pygame package’s documentation

It is primarily a standard Python (2 and 3) module reimplementing the SimpleGUI particular module of CodeSkulptor (a browser Python interpreter).

Simply change

import simplegui

by

try:
    import simplegui
except ImportError:
    import SimpleGUICS2Pygame.simpleguics2pygame as simplegui

in your CodeSkulptor program and your program run both in CodeSkulptor and standard Python with this module (and Pygame).

SimpleGUICS2Pygame

Online HTML documentation on Read The Docs. (You can also see the online SimpleGUI documentation on CodeSkulptor.)

(This is the online HTML documentation of the working version. You can find the HTML documentation of the last stable version in the Bitbucket download section https://bitbucket.org/OPiMedia/simpleguics2pygame/downloads .)


If you have some problem

First, read this short main documentation page, this Compatibility page and this Tips page.

If you have problem with some command, you can see its documentation in the modules page or by the Index page .

Next, you can search in Stack Overflow. If you don’t find answer, you can ask question like this.

Finally you can email me. I will try to help you with pleasure. (You can write me in French.)

Installation

If pip is installed on your platform you can do:

>>> pip install SimpleGUICS2Pygame

(If several Python implementations are installed, maybe you must use something like pip2 or pip3 instead pip command.)

Without pip, download the archive SimpleGUICS2Pygame-?.tar.gz, unzip it somewhere. Next in the somewhere/SimpleGUICS2Pygame-?/ subdirectory run:

>>> python setup.py install

In both cases, you must use admin access. So with GNU/Linux you will probably do:

>>> sudo [your command]

Module simpleplot require matplotlib (and must be installed separately).

Modules simplegui_lib (and its submodules) and simpleguics2pygame (except for the Timer class) require Pygame (and must be installed separately).

Test installation

You can run the little script SimpleGUICS2Pygame_check.py to check if all required modules are installed.

Examples of good installation: result in Python 2 and result in Python 3.

You can also test your Pygame installation alone with the other little script pygame_check.py.

Update

With pip installed on your plaftorm you can update SimpleGUICS2Pygame:

>>> pip install SimpleGUICS2Pygame --upgrade

Complete installation on Window$ in few steps

  1. Download and run the good Pygame installation file: Unofficial Windows Binaries Pygame. (Only require for simplegui_lib, its submodules and simpleguics2pygame.)
  2. Download and run the good matplotlib installation file (and all its requirements): Unofficial Windows Binaries matplotlib. (Only require for simpleplot.)
  3. Download and run the good setuptools installation file: Unofficial Windows Binaries setuptools.
  4. Download and run the good pip installation file: Unofficial Windows Binaries pip.
  5. Run in the Command Prompt (maybe with Administrator rights): pip install SimpleGUICS2Pygame . (Probably the pip command aren’t in your PATH, so add it or move in the subdirectory of pip with the CD command. This subdirectory is something like C:\Python?\Scripts\ .)

Examples of CodeSkulptor and SimpleGUICS2Pygame use

You can see examples in SimpleGUICS2Pygame/example/ subdirectory from the sources archives.

Or online: Python programs running in CodeSkulptor .

Two simple online examples:

Message to developers

This is a free software, so you can download it, modify it and submit your modifications. You can also redistribute your own version (keeping the GPL license).

Complete sources on Bitbucket: https://bitbucket.org/OPiMedia/simpleguics2pygame

See developers‘page.

Author OPi

Olivier Pirson OPi — http://www.opimedia.be/

Other free softwares on my Bitbucket account: https://bitbucket.org/OPiMedia

Support me

This package is a completely free software, see GPL license. So it is completely free (like “free speech” and like “free beer”). However you can support me financially by donating.

Go to the link Donate. Thank you!

Note that

  • SimpleGUI of CodeSkulptor (Scott Rixner) is a specific module of CodeSkulptor, written in JavaScript.

    CodeSkulptor is a Python implementation running in a browser. It implements a subset of Python 2. It is the environment used in the course An Introduction to Interactive Programming in Python (Rice University, Coursera).

  • SimpleGUICS2Pygame (Olivier Pirson) is this package. It is fully compatible with Python 2 and 3.

    It contains codeskulptor, numeric, simpleguics2pygame and simpleplot modules that reimplement codeskulptor, numeric, simplegui and simpleplot modules of CodeSkulptor.

    Warning

    SimpleGUICS2Pygame was designed to mimic behavior of CodeSkulptor. So load_image() and load_sound() methods can load medias only from URL, not local files. However SimpleGUICS2Pygame can save these medias to a specific local directory. See the Download medias tips.

    You can also use specific _load_local_image() and _load_local_sound() methods to load local files. But be careful, each specific method doesn’t exist in CodeSkulptor.

    There exist some little differences between SimpleGUICS2Pygame and SimpleGUI of CodeSkulptor. See Compatibility notes.

  • SimpleGUITk (David Holm) is another implementation of SimpleGUI of CodeSkulptor, using Tkinter and some others packages. It is really less complete and not updated. However it works for some programs.

Warning

  • simplegui (Florian Berger) is a Python package which has the same name as SimpleGUI of CodeSkulptor, but it is totally something else.

Indices and tables