streaming a file object through re.finditer

2005-02-02 Thread Erick
Hello, I've been looking for a while for an answer, but so far I haven't been able to turn anything up yet. Basically, what I'd like to do is to use re.finditer to search a large file (or a file stream), but I haven't figured out how to get finditer to work without loading the entire file into mem

Re: Easy Q: dealing with object type

2005-02-02 Thread Erick
Ah, you're running into the "old-style classes vs. new style classes". Try subclassing from "object". For example: >>> class A(object): ... pass ... >>> a=A() >>> type(a) >>> type(a) == A True >>> type(a) is A True >>> b=A() >>> type(a) == type(b) True >>> type(a) is type(b) True Check out t

Re: streaming a file object through re.finditer

2005-02-02 Thread Erick
Ack, typo. What I meant was this: cat a b c > blah >>> import re >>> for m in re.finditer('\w+', file('blah')): ... print m.group() ... Traceback (most recent call last): File "", line 1, in ? TypeError: buffer object expected Of course, this works fine, but it loads the file completely into m

Re: Easy Q: dealing with object type

2005-02-02 Thread Erick
Ah, you're running into the "old-style classes vs. new style classes". Try subclassing from "object". For example: >>> class A(object): ... pass ... >>> a=A() >>> type(a) >>> type(a) == A True >>> type(a) is A True >>> b=A() >>> type(a) == type(b) True >>> type(a) is type(b) True Check out t

Re: streaming a file object through re.finditer

2005-02-02 Thread Erick
True, but it doesn't work with multiline regular expressions :( -e -- http://mail.python.org/mailman/listinfo/python-list

Re: streaming a file object through re.finditer

2005-02-03 Thread Erick
I did try to see if I could get that to work, but I couldn't figure it out. I'll see if I can play around more with that api. So say I did investigate a little more to see how much work it would take to adapt the re module to accept an iterator (while leaving the current string api as another code

Fwd: bug in download

2020-12-16 Thread Erick Willum
Begin forwarded message: > From: Erick Willum > Date: 16 December 2020 at 15:53:40 GMT > To: python-list@python.org > Subject: bug in download > > Hallo and good afternoon, > > Having installed python (big thank you) and sublime text, i get the next > message wh

python-ldap reading an OU with more than 1000 objects

2008-10-17 Thread Erick Perez - Quadrian Enterprises, S.A.
time.sleep(1) os.system(pathtozmprov +' ca %s %s displayName "%s"' % (accountname,password,name)) print "Creando Alias" os.system(pathtozmprov +' aaa %s %s' % (accountname,alias1)) time.sleep(1) else: print accountname, alias1, " user is not a member of the ZimbraMail AD Group. Will not be processed\n" #--- --- except ldap.LDAPError, error_message: print error_message l.unbind_s() thanks all for your comments. Erick. -- http://mail.python.org/mailman/listinfo/python-list