VB code -> Python

Mikael Lexén mikael.lexen at stop.spam.volvo.com
Fri Feb 15 05:07:04 EST 2002


Hi

I have the following VB code snippet:

    Set oContext = GetObjectContext
    Err.Clear
    Set oUser = GetObject("WinNT://" & CStr(Domain) & "/" &
CStr(UserID))
    If Err = 0 Then
        For Each oGroup In oUser.Groups
            If UCase(Groupname) = UCase(oGroup.Name) Then
                MemberofGroup = True
                'Exit Function
                Exit For
            End If
        Next
        oContext.SetComplete
    Else
        oContext.SetAbort
        MemberofGroup = False
    End If

So my questin is how do I translate the GetObject(...) thing in to
Python code. I have looked in the win32 ref doc but I can't figure out
out how to do it and a search in Google didn't help me much either. So
any help is appreciated.

--
/Mikael





More information about the Python-list mailing list