def getlogin():
 if (sys.platform != 'win32'):
  import pwd
  return pwd.getpwuid(os.getuid())[0]
 else:
  return os.environ['USERNAME']

def getlogin ( ) : if ( sys . platform != 'win32' ) : import pwd return pwd . getpwuid ( os . getuid ( ) ) [ 0 ] else : return os . environ [ 'USERNAME' ]
avoid using os .