"Greg McIntyre" <[EMAIL PROTECTED]> writes:
> My files are large, hence 1 character at a time, not f.read().

There are alternatives between the two. You could read in a chunk of
reasonable size for your platform. Say 10meg on a recent workstation,
or 100meg on a current workstation.

> This is code from another employee and I'm just in the stages of going
> through it and doing a basic clean-up before I get on to a proper
> efficiency assessment, hence I don't want to change the way it works,
> just make it as short and lucid as I can.

Well, the thing that has been hinted around but not explicitly stated
is that doing thing one character at a time in Python is a "code
smell", by which I mean it's an indication that there could be a
better way to do things, and it's probably worthwhile spending a
little time looking for it. On the other hand, if you've already
planned another pass over the code, that might be the time to look
into this.

     <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to