setting up python-simplegui library

CodeSkulptor is a web-based python compiler/interpreter, That I have been using for the Interactive Python course offered on Coursera .
And being were I am now, which is in Marion Island – our internet can be so slow at times so I resulted on running my python codes on my local machine not needing to go to CodeSkulptor.

I had troubles importing simplegui library, So after vigorous google searches I finally found a way to run codes needing simplegui library

1. Install

 sudo apt-get install python-dev ipython python-numpy python-matplotlib python-scipy python-pygame python-pip python.h python-setuptools

2. Download and install

tar xzvf SimpleGUICS2Pygame-01.07.00.tar.gz
sudo python install

3. run python on CLI

import SimpleGUICS2Pygame.simpleguics2pygame as simplegui

then test it.

import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
message = "Welcome!"

# Handler for mouse click
def click():
global message
message = "Good job!"

# Handler to draw on canvas
def draw(canvas):
canvas.draw_text(message, [50,112], 48, "Red")

# Create a frame and assign callbacks to event handlers
frame = simplegui.create_frame("Home", 300, 200)
frame.add_button("Click me", click)

# Start the frame animation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s