def logonUser(loginString):
 (domain, user, passwd) = loginString.split('\n')
 return win32security.LogonUser(user, domain, passwd, win32con.LOGON32_LOGON_INTERACTIVE, win32con.LOGON32_PROVIDER_DEFAULT)

def logonUser ( loginString ) : ( domain , user , passwd ) = loginString . split ( '\n' ) return win32security . LogonUser ( user , domain , passwd , win32con . LOGON32_LOGON_INTERACTIVE , win32con . LOGON32_PROVIDER_DEFAULT )
login as specified user and return handle .