CodeSkulptor3 loading...
xxxxxxxxxx
# CodeSkulptor runs Python programs in your browser.
# Click the upper left button to run this simple demo.
# CodeSkulptor is tested to run in recent versions of
# Chrome, Firefox, Safari, and Edge.
import 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()
Enter Session ID (or leave empty for new session):