def author_name():
 import getpass
 name = getpass.getuser()
 try:
  import pwd
  login = name
  name = pwd.getpwnam(login)[4]
  name = ''.join(name.split(','))
  if (not name):
   name = login
 except:
  pass
 try:
  name = name.decode('utf-8')
 except AttributeError:
  pass
 return name

def author_name ( ) : import getpass name = getpass . getuser ( ) try : import pwd login = name name = pwd . getpwnam ( login ) [ 4 ] name = '' . join ( name . split ( ',' ) ) if ( not name ) : name = login except : pass try : name = name . decode ( 'utf-8' ) except AttributeError : pass return name
utility to compute logged in user name :returns: name of current user .