def get_link_target(link):
 target = os.readlink(link)
 if (not os.path.isabs(target)):
  target = os.path.join(os.path.dirname(link), target)
 return os.path.abspath(target)

def get_link_target ( link ) : target = os . readlink ( link ) if ( not os . path . isabs ( target ) ) : target = os . path . join ( os . path . dirname ( link ) , target ) return os . path . abspath ( target )
get an absolute path to the target of link .