Skip to content

Instantly share code, notes, and snippets.

@alvesjnr
Created June 7, 2012 08:14
Show Gist options
  • Save alvesjnr/2887354 to your computer and use it in GitHub Desktop.
Save alvesjnr/2887354 to your computer and use it in GitHub Desktop.
How to get the subclass path
import inspect
import os
class F(object):
@classmethod
def _get_path(cls):
"""
If called by subclass of F will return the path
of the subclass
"""
return os.path.dirname(inspect.getabsfile(cls))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment