I am learning Python from Coursera. In this course they use SimpleGUI module on CodeSkulptor. Can anyone tell me how to integrate SimpleGUI with python 2.7 and 3.0 shell?
How to integrate SimpleGUI with Python 2.7 and 3.0 shell
42.6k Views Asked by Tahmeedbuet AtThere are 7 best solutions below

You can use my
SimpleGUICS2Pygame package.
Objectively, this is the best solution :-)
The package implement simplegui, codeskulptor, numeric and simpleplot modules.
If your Python tools are up to date, it is easy to install:
python -m pip install SimpleGUICS2Pygame --user --upgrade
- Online HTML documentation: https://simpleguics2pygame.readthedocs.io/
- Sources: https://bitbucket.org/OPiMedia/simpleguics2pygame
In your code, replace the import command
import simplegui
by
try:
import simplegui
except ImportError:
import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
and your code run in CodeSkulptor and in standard Python (2 and 3) with this package.
Note that:
- SimpleGUITk is an other implementation, using Tkinter and some others packages. It is really less complete and not updated. However it works for some programs.
- simplegui is a Python package which has the same name as SimpleGUI of CodeSkulptor, but it is totally something else.

I just installed simpleguitk to enable simplegui on my os. I am using linuxmint 15. Steps are:
First download simpleguitk from this link simpleguitk. In order to work with simplegui perfectly you have to install these packages
Pillow in order to use images.
Pygame for sound support
matplotlib for SimplePlot support.
You can install Pygame by suing this command :
sudo apt-get install python-pygame
You can install matplotlib by using this command :
sudo apt-get install python-matplotlib
To install Pillow , download zip file from this link Pillow
Unzip it and change directory to Pillow. Then use this command
python setup.py install (assuming you've already installed python.h or you can install it usingsudo apt-get install python.h
Finally you have to install simpleguitk . Before installing it i suggest you to install this module setuptools.
you can install setuptools using this command :
sudo apt-get install python-setuptools
Now Extract simpleguitk on your home directory. Then change directory to simpleguitk folder.
After that use this command :
python setup.py install
Type python
on terminal
Import simpleguitk as simplegui

I don't see any information on PyPI about which versions of Python simpleGUI supports. You can just try running it with Python 3 and see what happens. If it doesn't work, try using the 2to3 tools: http://docs.python.org/2/library/2to3.html
Note that simpleGUI is based on Tkinter. I would recommend learning a full GUI toolkit like Tkinter, wxPython or PySide rather than a derivative.

SimpleGUITk can be used in Python 3.
The Problem is simplegui.py
Just install SimpleGUITk as described in the README of the package.
Then modify the simplegui.py file in the python33 folder with an text-editor.
In the file are some calls for Tkinter. Just replace Tkinter with tkinter and everything is fine and the example in the readme runs without errors.
(I also make a Coursera course. But the SimpleGUI module is not the simplegui used in CodeSkulptor. Sorry, so you can't write programs for CodeSkulptor in IDLE with this lib)

You can just use SimpleGUITk (http://pypi.python.org/pypi/SimpleGUITk) which implements a Tk version of simplegui.
To use your CodeSkulptor code in the desktop, you just need to replace
import simplegui
with
import simpleguitk as simplegui
and that's it, your program made for CodeSkulptor code should work on the desktop.

Note: Steps is for windows
The replacement for simplegui is SimpleGUICS2Pygame.
Steps to install:
-
Step 1: Install Python 2.7 and Simpleguics2Pygame from : https://pypi.python.org/packages/source/S/SimpleGUICS2Pygame/SimpleGUICS2Pygame-01.08.00.tar.gz#md5=e4a18fe83e4a64c6222bfb71349be31e
Step 2: Extract it to a location (Lets call it somewhere)
Step 3: Open command prompt as administrator and change directory using the command
cd somewhere/SimpleGUICS2Pygame-01.08.00.
Step 4: Run the command setup.py install
SimpleGUICS2Pygame is now installed and can now be accessed using the following code instead of import simplegui
:
try:
import simplegui
except ImportError:
import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
From the coursera forums by Darren Gallagher
The full thread can be found here Can the staff give us the SIMPLEGUI module? (Note need to be enrolled to the course to view the link)
A python package called SimpleGUICS2Pygame has since been created to run CodeSkulptor code using Pygame, I haven't tried it myself yet but it can be found here