Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
Search or compai problem
 

Index | Next | Previous | View Flat


Tim.Gallagher at gd-ais

Aug 18, 2006, 2:12 PM


Views: 147
Permalink
Search or compai problem

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

Subject User Time
Search or compai problem Tim.Gallagher at gd-ais Aug 18, 2006, 2:12 PM
    Re: Search or compai problem sjmachin at lexicon Aug 18, 2006, 3:55 PM
    Re: Search or compai problem timgerr at gmail Aug 18, 2006, 9:16 PM
    Re: Search or compai problem gagsl-py at yahoo Aug 18, 2006, 11:00 PM
    Re: Search or compai problem timgerr at gmail Aug 19, 2006, 7:43 PM
    Re: Search or compai problem gagsl-py at yahoo Aug 21, 2006, 10:02 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.