Hey everybody, Upon initialization I'd like to set an assets path, which will be different depending on platform. I'd like to set it one time upon startup, and then have every module import it automatically with the changed value. However since modules are loaded once and persisted in their original state, I can't get the new value in the new module, even if I reload(settings) .
The best option I can think of is actually creating a new module as a new file, then importing that new module in every subsequent piece that needs it. But I was hoping to do something a little more elegant than that. Do we have any sort of application-level variables which are muteable? Like an application-level memory space? ---------- main.py: import settings if android: settings.assets = './assets' else: settings.assets = 'c:/my/sources/in/development/bla/bla' then in a future module something like this: ---------- gameloop.py: import settings ASSETS_DIRECTORY = settings.assets player_img = pygame.image.load(ASSETS_DIRECTORY + 'player.png') -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow