'How do I access an array from a different module to load an image?

self.Image = pygame.image.load(array[])

This is the piece of code I am using to load my image. I would like to know how it would instead be possible to use an array of images in the brackets and the specific image used would be based on what image they chose from the array in another module. I have another module in which the user selects what image they want to use but do not know how to access the chosen value of that array to then be used for the program itself. In other words, if they pick "image1" from the array menu, the game subsequently is able to load "image1" in the game or load whatever image the user chose.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source