Is there a way to access the value of a variable without taking the variables name? I am trying to write a project which has an external constants file for colour definitions which I will use in the various programs to de-clutter my code.
The colours are set as RGB with the colour name such as:
BLACK = (0,0,0)
An example of the class which will use the colour is:
class Window:
    def __init__(self,w_width,w_height,w_colour,fps=60):
        pygame.init()
        self.w_width = w_width
        self.w_height = w_height
        self.fps = fps
        self.w_colour = w_colour
        self.screen = pygame.display.set_mode((self.w_width,self.w_height))
        self.clock = pygame.time.Clock()
        self.screen.fill(constants.self.w_colour)
And am coming into the error where constants.self.w_colour doesn't exist (which I understand as i'm assuming it is looking for a self.w_colour within the constants file which I know doesn't exist).  But the value of self.w_colour could be BLACK or some other value which I know is contained in the constants file.
I was wondering if there is a way to call the constants.self.w_colour by taking the value of self.w_colour and not python trying to follow it as a path?
Apologies if it doesn't make much sense but i've tried to describe it in the best way I can.
 
     
    