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
If you have problem with some command, you can see its documentation in the modules 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.
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).
You can run the little script SimpleGUICS2Pygame_check.py to check if all required modules are installed.
You can also test your Pygame installation alone with the other little script pygame_check.py.
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 package is a completely free software (GPL license). So it is completely free (like "free speech" and like "free beer"). However you can support me financially by donating.
Copyright (C) 2013, 2014, 2015, 2016, 2018 Olivier Pirson
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
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.
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.
- simplegui (Florian Berger) is a Python package which has the same name as SimpleGUI of CodeSkulptor, but it is totally something else.
- 02.00.00 WORKING VERSION — April 1st, 2018
- Added a developer's page in documentation.
- Replaced links of Read the Docs.
- Added --last command line option.
- Added test/test_command_line_options.py.
- Replaced _WEBSITE value by documentation link.
- Splitted media links to image links and sound links.
- Added script/pygame_check.py to check Pygame installation alone.
- Added ValueError exception if draw_text() try to draw a text containing unprintable whitespace character.
- Added draw_text_multi() in simplegui_lib_draw.
- Updated test/test_text.py.
- Added alpha possibility on background color.
- Added transparent "color" name.
- Improved dealing of input box.
- Added test/test_input.py.
- Updated simpleplot module, to "run" same if matplotlib is not installed.
- Updated test/test_objects.py.
- Corrected "Read the Docs" subpackage problem.
- Updated test/test_sound.py.
- Updated script/SimpleGUICS2Pygame_check.py.
- Splitted the big file ``simpleguics2pygame.py``.
- Added example/presentation.py.
- Added example/stop_example.py.
- Corrected test/test_sound.py.
- Updated documentation. (Thanks to John Gray.)
- Updated media and CodeSkulptor programs links.
- 01.09.00 — January 1st, 2015
- Added ``_load_local_image()`` and ``_load_local_sound()`` functions.