Skip to main content

Primarily a standard Python (2 and 3) module reimplementing the SimpleGUI particular module of CodeSkulptor (a Python browser environment). In fact a package also with other modules adapted from CodeSkulptor.

Project description

It is primarily a standard Python (2 and 3) module reimplementing the SimpleGUI particular module of CodeSkulptor and CodeSkulptor3 (a Python browser environment). This is in fact a package also with other modules adapted from CodeSkulptor.

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 or SimpleGUI documentation on CodeSkulptor3.)


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.

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.


Installation

Installation requires that Python tools are up to date. If not, then see the Online HTML documentation. Else, simply do:

$ python -m pip install SimpleGUICS2Pygame --user

Note that $ represents the prompt and do not be entered by you.

If several Python implementations are installed, maybe you must use something like python2 or python3 instead python command.

With the --user option the installation is made in the user directory and doesn’t require administrator rights.

Normally all requirements are automatically installed. But for that you need have pip and other installation packages installed and up to date.

On Arch Linux you can use this package installation script (written by Danny Fajardo): Arch_Linux/PKGBUILD.


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: 🌳 Olivier Pirson — OPi OPi 🇧🇪🇫🇷🇬🇧 🐧 👨‍💻 👨‍🔬

🌐 Website: http://www.opimedia.be/

💾 Bitbucket: https://bitbucket.org/OPiMedia/


Support me

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.

Click to this link Donate Thank you!


License: GPLv3 GPLv3

Copyright (C) 2013-2016, 2018, 2020 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 <https://www.gnu.org/licenses/>.


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).

  • SimpleGUI of CodeSkulptor3 (Scott Rixner) is the same in the new version CodeSkulptor3 that implements a subset of Python 3.

  • 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.

  • 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.

  • simplequi (Arthur Gordon-Wright) is another implementation of SimpleGUI of CodeSkulptor, using Qt/PySide2. It is a partial implementation that I have not tested.


Changes

  • 2.1.0 — November 29, 2020

    • Removed Pygame restriction to version 1.9.6.

    • Removed old special cases when Pygame was not installed.

    • Cleaned some warnings from mypy.

    • example/Nostalgic_Basic_Blitz.py: corrected bug with negative position of bomb.

  • 2.0.3 — October 2, 2020

    • Corrected reading permission of files in distribution files.

    • Added Arch Linux installation script (written by Danny Fajardo).

  • 2.0.2 — May 23, 2020

    • Documentation:

      • Updated image and sound links.

    • Tests:

      • Completed missing type annotations in simpleguics2pygame/control.

  • 2.0.1 — May 21, 2020

    • Documentation:

      • Added class diagram generated by Pyreverse.

      • Updated image and CodeSkulptor program links.

    • Program examples:

      • Adapted example/Memory.py with images moved to HTTPS.

    • Tests:

      • Added type annotations (in Python 2 mode) for each function.

      • Cleaned some type annotations instead ignore them.

  • 2.0.0 — April 18, 2020

    • Converted from Mercurial version control system to Git.

    • Corrected files included in MANIFEST.in for distribution building. (Thanks to 7coil.)

    • Improved installation. Now all requirements are automatically installed.

    • Modules:

      • Splitted the big file ``simpleguics2pygame.py``.

      • Added alpha possibility on background color.

      • Added dealing of joypads.

      • Added dealing of MP3 sounds. Added draw_arc() in Canvas and test_arc.

      • Added Frame.download_canvas_image(), Frame._cursor_auto_hide and Frame._set_cursor_visible().

      • Added codeskulptor_version() in codeskulptor_lib.

      • Added draw_text_multi() in simplegui_lib_draw.

      • Added --frame-padding (thanks to 7coil), --last, --help, --print-application-args, --print-args and --version command line options.

      • Added randomize_iteration() in codeskulptor.

      • Added transparent “color” name.

      • Added ValueError exception if draw_text() try to draw a text containing unprintable whitespace character.

      • Corrected keys parameter use in simplegui_lib_keys.Keys().

      • Improved dealing of input box.

      • Updated simpleplot module, to “run” same if matplotlib is not installed.

    • Documentation:

      • Corrected “Read the Docs” subpackage problem.

      • Added a developer’s page.

      • Replaced _WEBSITE value by documentation link.

      • Updated. (Thanks to John Gray and Tom Keller.)

      • Splitted media links to image links and sound links.

      • Updated installation documentation.

      • Updated media and CodeSkulptor programs links.

    • Program examples:

      • Added example/presentation.py.

      • Added example/stop_example.py.

      • Moved from CodeSkulptor to CodeSkulptor3.

    • Scripts:

      • Added script/pygame_check.py to check Pygame installation alone.

      • Updated script/SimpleGUICS2Pygame_check.py.

    • Tests:

      • Added static checking in Makefile, and corrected a lot of style warnings.

      • Corrected and updated test/test_sound.py.

      • Added test/test_command_line_options.py.

      • Added test/test_input.py.

      • Updated test/test_dir.py.

      • Updated test/test_objects.py.

      • Updated test/test_text.py.

Complete changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SimpleGUICS2Pygame-2.1.0.tar.gz (1.7 MB view details)

Uploaded Source

File details

Details for the file SimpleGUICS2Pygame-2.1.0.tar.gz.

File metadata

  • Download URL: SimpleGUICS2Pygame-2.1.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for SimpleGUICS2Pygame-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ba4e1d7e0aadaf8883a1a2e5e840215e964881c1e085fda518f7ab333a8ff9e3
MD5 55c677ca332f1a46c8f34ed258ee6ac2
BLAKE2b-256 8d3cfa1a023b8431bf175406c2d31f57f22f377680ae8db3ba6b7e0df3204922

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page