get_script_home Function

Defined in pyglet.resource

get_script_home()

Get the directory containing the program entry module.

For ordinary Python scripts, this is the directory containing the __main__ module. For executables created with py2exe the result is the directory containing the running executable file. For OS X bundles created using Py2App the result is the Resources directory within the running bundle.

If none of the above cases apply and the file for __main__ cannot be determined the working directory is returned.

When the script is being run by a Python profiler, this function may return the directory where the profiler is running instead of the directory of the real script. To workaround this behaviour the full path to the real script can be specified in pyglet.resource.path.

Return type:str

Previous topic

get_cached_texture_names Function

Next topic

get_settings_path Function