I am new to python and I want to compare 2 strings, here is my code:
[start]
import active_director y
import re
lstUsers = []
users = active_director y.root()
for user in users.search ("sn='gallagher '"):
lstUsers.append (user.samAccoun tName)
print "----------------------------------------"
lstUsers.sort()
## Printing out what is inside of the arrar(list)
x = 0
while x < len(lstUsers):
if re.compile(lstU sers[x]).match("None", 0):
print "Somthing here"
x = x + 1
[/end]
When I do the:
if re.compile(lstU sers[x]).match("None", 0):
print "Somthing here"
Some of the items in lstUsers[x] are the word None. I am not sure why I
cant do this
I want to compare lstUsers[x] to the word "None", how can I do this.
Thanks
Timothy F. Gallagher
CSC Systems Engineer
[start]
import active_director y
import re
lstUsers = []
users = active_director y.root()
for user in users.search ("sn='gallagher '"):
lstUsers.append (user.samAccoun tName)
print "----------------------------------------"
lstUsers.sort()
## Printing out what is inside of the arrar(list)
x = 0
while x < len(lstUsers):
if re.compile(lstU sers[x]).match("None", 0):
print "Somthing here"
x = x + 1
[/end]
When I do the:
if re.compile(lstU sers[x]).match("None", 0):
print "Somthing here"
Some of the items in lstUsers[x] are the word None. I am not sure why I
cant do this
I want to compare lstUsers[x] to the word "None", how can I do this.
Thanks
Timothy F. Gallagher
CSC Systems Engineer
Comment