I am making games in Python. Since I am using Python3, I have to cx_Freeze my scripts into executables to let other people who don't have Python3 run the games. I've put the resources (textures, audio, files etc.) in a folder that was related to the script path. When I didn't cx_Freeze the script, I used __file__ to locate the script and use this to locate the resources and use them. But once frozen using cx_Freeze, this method doesn't work.
My question is, how can find the file path of a script after it is being frozen using cx_Freeze?
I've tried __file__, os module and any other modules related to file paths.
path = str(__file__).split("/")
path.remove("My executable name")
path.remove("MacOS")
path = "/".join(path) + "/Resources/"
I expected to return my Resources folder, but __file__ only returns my home directory so this causes a traceback.