SimpleGUICS2Pygame package’s documentation¶
It is primarily a standard Python (2 and 3) module reimplementing the SimpleGUI particular module of CodeSkulptor2 and CodeSkulptor3 (a Python browser environment). This is in fact a package also with other modules adapted from CodeSkulptor.
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).
If you have some problem¶
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.)
Before the installation of SimpleGUICS2Pygame¶
Obviously you need Python.
If pip (the Python Package Installer) is not installed on your system, then install it with:
$ python -m ensurepip --user
$ represents the prompt and do not be entered by you.
If several Python implementations are installed,
maybe you must use something like
the installation is made in the user directory
and doesn’t require administrator rights.
Before installation, as a precaution, upgrade necessary installation packages:
$ python -m pip install pip setuptools wheel --user --upgrade
Installation of SimpleGUICS2Pygame¶
$ python -m pip install SimpleGUICS2Pygame --user --upgrade
Followed requirements are automatically installed.
But if the installation failed, then install them separately and after that try again to install SimpleGUICS2Pygame.
On Arch Linux you can use this package installation script (written by Danny Fajardo): Arch_Linux/PKGBUILD.
Pygame is required to use module
simplegui_lib (and its submodules)
simpleguics2pygame of SimpleGUICS2Pygame
(except for the Timer class).
Normally Pygame is installed automatically when you install SimpleGUICS2Pygame. But if it is failed then install it like this first.
$ python -m pip install pygame --user --upgrade
If you have some problem, see installation documentation of pygame.
On Window$ you can also directly install a binary from the Unofficial Windows Binaries for Python Extension Packages: Pygame binary.
audioread is required to play MP3 sounds (other sounds are played by Pygame).
Package matplotlib required¶
matplotlib is required to use module
simpleplot of SimpleGUICS2Pygame.
If you have some problem, see installation documentation of matplotlib.
On Window$ you can also directly install matplotlib binary.
You can run the little script
to check if all required modules are installed.
You can also test your Pygame installation alone with the other little script
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 .
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
This program is a free software (GPL license). It is completely free (like “free speech” and like “free beer”). However you can support me financially by donating.
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.
simpleplotmodules that reimplement
simpleplotmodules of CodeSkulptor.
simplemapis not implemented.
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.
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.
simplegui2pygamemodule (Jimmy Kumar Ahalpara) seems be another implementation of SimpleGUI of CodeSkulptor, but I have not tested it.
simplequi (Arthur Gordon-Wright) is another implementation of SimpleGUI of CodeSkulptor, using Qt/PySide2. It is a partial implementation that I have not tested.
Table of contents¶
- Package SimpleGUICS2Pygame
- All modules of this package
- codeskulptor — replace the codeskulptor module of CodeSkulptor
- codeskulptor_lib — some miscellaneous functions
- numeric — replace the numeric module of CodeSkulptor
- simplegui_lib — simply import the following modules
- simpleguics2pygame — the main module, replace the simplegui module of CodeSkulptor
- simpleplot — replace the simpleplot module of CodeSkulptor
- License: GPLv3
- Known bugs
- List of online programs
- List of online images
- List of online sounds