[Tutor] Re: Python question (when you have a free moment) (fwd)

Deirdre Saoirse deirdre@deirdre.net
Fri, 20 Aug 1999 15:05:08 -0700 (PDT)


On Fri, 20 Aug 1999, David Ascher wrote:

> On Fri, 20 Aug 1999, Deirdre Saoirse wrote:
> 
> > A friend of mine, a molecular biologist, has a problem. He has a file,
> > approximately 1.5mb, that has a bunch of returns in it (which interfere
> > with his ability to perform raw searches).
> 
> 1.5M isn't that big.  

Well, that was where he was starting. :)

> Why not just:
> 
>   data = open('~/yeast/chromosome04', 'r').read()
>   data = string.replace(data, '\r', '')
> 
> This takes negligible time on my machine.

Interesting! I'm always amazed by this list. :)

(though what is replaced is somewhat OS-dependent; I believe he's running
on Unix)

-- 
_Deirdre   *   http://www.linuxcabal.net   *   http://www.deirdre.net
"I must say that I was really happy to see _Linux for Dummies_ -- that's 
when you know you've arrived." -- Linus Torvalds