function = getattr(Color, color) function() # For each intensity... for intensity in ("light", "dark"): # Set the intensity. function = getattr(Color, intensity) function() # Print a message. print "This is %s %s text on black background." % (intensity, color) # Set black text. Color.black() # For each color... for color in ("red", "green", "blue", "cyan", "magenta", "yellow", "white"): # Set the background color. function = getattr(Color, "bk_" + color) function() # For each intensity... for intensity in ("light", "dark"): # Set the background intensity. function = getattr(Color, "bk_" + intensity) function()
# Set the color. function = getattr( Color, color ) function() # For each intensity... for intensity in ( "light", "dark" ): # Set the intensity. function = getattr( Color, intensity ) function() # Print a message. print "This is %s %s text on black background." % ( intensity, color ) # Set black text. Color.black() # For each color... for color in ( "red", "green", "blue", "cyan", "magenta", "yellow", "white" ): # Set the background color. function = getattr( Color, "bk_" + color ) function() # For each intensity... for intensity in ( "light", "dark" ): # Set the background intensity. function = getattr( Color, "bk_" + intensity ) function()