It would be a good idea to check the current working directory during runtime using os.getcwd(). After finding the current working directory, add the assets relative to that path. For example, You could place bg.jpg at /python/game/assets/ and write:
bif=r"python/game/assets/bg.jpg"