def get_gid(group=None):
 if (grp is None):
  result = None
 elif (group is None):
  try:
   result = os.getegid()
  except AttributeError:
   result = None
 else:
  try:
   g_struct = grp.getgrnam(group)
  except KeyError:
   result = None
  else:
   result = g_struct.gr_gid
 return result

def get_gid ( group = None ) : if ( grp is None ) : result = None elif ( group is None ) : try : result = os . getegid ( ) except AttributeError : result = None else : try : g_struct = grp . getgrnam ( group ) except KeyError : result = None else : result = g_struct . gr_gid return result
get the gid for a given group name .