Search or compai problem
Gallagher, Tim (NE)
Tim.Gallagher at gd-ais.com
Fri Aug 18 17:12:28 EDT 2006
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
More information about the Python-list
mailing list