I am new to python and I want to compare 2 strings, here is my code:
[start]
import active_directory
import re
lstUsers = []
users = active_directory.root()
for user in users.search ("sn='gallagher'"):
lstUsers.append(user.samAccountName)
print "----------------------------------------"
lstUsers.sort()
## Printing out what is inside of the arrar(list)
x = 0
while x < len(lstUsers):
if re.compile(lstUsers[x]).match("None",0):
print "Somthing here"
x = x + 1
[/end]
When I do the:
if re.compile(lstUsers[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
--
http://mail.python.org/mailman/listinfo/python-list