Title: """ Program: Pygame Standard Framework Description: your_des Author: Booze_Hound Pastebin link: http://pastebin.com/DYyfnxpk First Edit: Tuesday 24th of February 2015 03:03:45 PM CDT Last Edit: Tuesday 24th of February 2015 03:03:45 PM CDT """     Program:        Pygame Standard Framework     Description:    your_description_here     Name:           your_name_here     Class:          CIS151     Date:           date_due_here   """       #I - Import and initalise import pygame from random import randint pygame.init() screen = pygame.display.set_mode(    (640, 740)   ) from PIL import Image   # creating some constants that hold different colours RED    = (255, 0, 0) GREEN  = (0, 255, 0) BLUE   = (0, 0, 255) WHITE  = (255, 255, 255) BLACK  = (0,0,0) GRAY   = (190, 190, 190) YELLOW = (255, 255, 0) ORANGE = (255, 165, 0) PINK   = (255, 192, 203) PURPLE = (160, 32, 240) BROWN  = (139, 69, 19)   def main():     currentColor = WHITE     #D - Display configuration     pygame.display.set_caption("WoolyWilly!")     press=pygame.key.get_pressed()       #E - Entities (just background for now)     background = pygame.Surface(screen.get_size())     background = background.convert()     background.fill(WHITE)       startPosition = (50, 50)     endPosition = (200, 400)       foreground = pygame.Surface(screen.get_size())     foreground = foreground.convert()     foreground.fill(WHITE)       """     setting currentColor to the 1st selection so it won't crash on clicking     and paint must be selected first     """     currentColor = WHITE             # create a Surface called willy and load an image into it     willy = pygame.image.load("willy.png")     willy = willy.convert()               pygame.image.save(willy, "willy-finished.jpg")                  #A - Action (broken into ALTER steps)           #A - Assign values to key variables     clock = pygame.time.Clock()     keepGoing = True     mouseClicked = False                 #L - Set up main loop     while keepGoing:           #T - Timer to set frame rate         clock.tick(30)           #E - Event handling         for event in pygame.event.get():             if event.type == pygame.QUIT:                 keepGoing = False                             if event.type == pygame.MOUSEMOTION:                 position = pygame.mouse.get_pos()                 position = str(position)                               # testing for different types of events             elif event.type == pygame.MOUSEMOTION:                 position = pygame.mouse.get_pos()                 position = str(position)                 pygame.display.set_caption(position)                             elif event.type == pygame.MOUSEBUTTONDOWN:                 mouseClicked = True               elif event.type == pygame.MOUSEBUTTONUP:                 mouseClicked = False                         #Added colors for 0-9                         elif event.type == pygame.KEYUP:                 if event.key == pygame.K_0:                     currentColor = RED                                     elif event.key == pygame.K_1:                     currentColor = GREEN                                     elif event.key == pygame.K_2:                     currentColor = BLUE                                     elif event.key == pygame.K_3:                     currentColor = WHITE                                     elif event.key == pygame.K_4:                     currentColor = BLACK                                     elif event.key == pygame.K_5:                     currentColor = GRAY                                     elif event.key == pygame.K_6:                     currentColor = YELLOW                                     elif event.key == pygame.K_7:                     currentColor = ORANGE                                     elif event.key == pygame.K_8:                     currentColor = PINK                                     elif event.key == pygame.K_9:                     currentColor = PURPLE                                 #Added a way to adjust the pen size.                                   elif event.key == pygame.K_PLUS                                       elif event.key == pygame.K_MINUS                   position = pygame.mouse.get_pos()                   pygame.draw.circle(willy, currentColor, position, 5)                                   #Hit space to reload                                 elif event.key == pygame.K_SPACE:                     willy = pygame.image.load("willy.png")                     willy = willy.convert()                             if mouseClicked:             position = pygame.mouse.get_pos()             pygame.draw.circle(willy, currentColor, position, 5)               #myLabel.update()           #R - Refresh display                 screen.blit(background, (0, 0))                 screen.blit(foreground, (0,0))         screen.blit(willy, (0, 0)  )         pygame.display.flip()     if __name__ == "__main__":     main()   pygame.quit()