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
wget https://pypi.python.org/packages/source/S/SimpleGUICS2Pygame/SimpleGUICS2Pygame-01.07.00.tar.gz tar xzvf SimpleGUICS2Pygame-01.07.00.tar.gz sudo python setup.py 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) frame.set_draw_handler(draw) # Start the frame animation frame.start()