Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: >> Any reason you can't just read the whole file at once and update m? > > Yes, you could say > > print md5.new(file('foo.exe').read()).hexdigest() > > > but that means reading the whole file into memory at once. If the > file is very large, that could thrash or fail. > >> Also, doesn't the parameter for update have to be a string? If you're >> reading the file in binary mode, would t still be a string? > > Yes, t would still be a string. You can have NUL bytes and so forth > in Python strings: > > len('ab\0cd') ==> 5
Thanks! I didn't expect it to be so easy. :) -- http://mail.python.org/mailman/listinfo/python-list