[Regexes] Stripping puctuation from a text

2008-05-22 Thread shabda raaj
I want to strip punctuation from text. So I am trying, >>> p = re.compile('[a-zA-Z0-9]+') >>> p.sub('', 'I love tomatoes!! hell yeah! ... Why?') ' !! ! ... ?' Which gave me all the chars which I want to replace. So Next I tried by negating the regex, >>> p = re.compile('^[a-zA-Z0-9]+') >>> p

Getting error zipimport.ZipImportError: can't decompress data; zlib not available

2007-09-10 Thread shabda raaj
I have a VPS server with fedora 7. I wanted to install easy_install on this server, but I got an error saying unable to open /usr/lib/ > python2.5/config/Makefile (No such file or directory). So I installed the latest version of python from source. Now when I am trying to install libraries, I am g

Re: Implementaion of random.shuffle

2007-07-17 Thread shabda raaj
Ah, thanks I get it now! --Shabda On Jul 17, 7:52 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 16 Jul 2007 14:45:48 +,shabdaraaj wrote: > > On Jul 16, 5:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >>shabdaraaj wrote: > >> > I was going through the docs for module-random > >>

Re: Implementaion of random.shuffle

2007-07-16 Thread shabda raaj
On Jul 16, 8:29 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: > > Steve Holden <[EMAIL PROTECTED]> writes: > > >> So it would appear that the developers chose the Knuth algorithm > >> (with a slight variation) for *their* implementation. Now you have > >> to ask yourself whethe

Re: Implementaion of random.shuffle

2007-07-16 Thread shabda raaj
On Jul 16, 5:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > shabda raaj wrote: > > I was going through the docs for module-random > > <http://docs.python.org/lib/module-random.html> And I came through this, > > > * shuffle*(x[, random]) > >

Implementaion of random.shuffle

2007-07-16 Thread shabda raaj
I was going through the docs for module-random And I came through this, *shuffle*( x[, random]) Shuffle the sequence x in place. The optional argument random is a 0-argument function returning a random float in [0.0, 1.0); by default, this is the fun