Created
October 18, 2013 12:57
-
-
Save chrisking/7041150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def resource_filename(base, path_to_append): | |
| """ | |
| resource_filename takes in any python object, preferably __name__. | |
| It then uses the OS module to determine the full path to the calling | |
| module, then that is joined with any additional path and it | |
| is returned. | |
| """ | |
| base_path = os.path.dirname(os.path.abspath(base)) | |
| return os.path.join(base_path, path_to_append) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment