def expand_path(path):
 return os.path.abspath(os.path.expandvars(os.path.expanduser(path)))

def expand_path ( path ) : return os . path . abspath ( os . path . expandvars ( os . path . expanduser ( path ) ) )
expands directories and globs in given path .