[Zope] Fw: [Zope] Comma delimited file and the re python object

Darrell dgallion@rochester.rr.com
Mon, 8 Nov 1999 15:39:23 -0500


> From: Jonothan Farr <jfarr@real.com>
> To: Darrell <dgallion@rochester.rr.com>
> > 
> > > ['Bond', ' James', '13', '45']
> > 
> > shouldn't that be ['Bond, James', '13', '45'] ? =)
> > 
> Yelp, that's one I fixed later.
> Here's my new test.
> I don't even have a use for this thing. Just sounded fun.
> 
> """
> Tests for splitQuote.pyd
> 
> """
> from splitQuote import *
> import time
> 
> txt=r'''
> "Bond, James", 13, 45
> 'That\'s "absolutely","possible."', 1999, 8, 30
> """now"",""is"\'"",the,555,"""time"""
> '''
> #"""
> 
> print split.__doc__
> buf=txt*2
> print 'Buf len:',len(buf)
> t1=time.time()
> l=split(buf)
> print 'Num records:',len(l)
> print "Time: %.2f"%(time.time()-t1)
> for x in range(4):
>     print l[x]
> valid=[['Bond, James', '13', '45'],
> ['That\\\'s "absolutely","possible."', '1999', '8', '30'],
> ['""now"",""is"\\\'"', 'the', '555', '""time""'],
> ['Bond, James', '13', '45'],
> ['That\\\'s "absolutely","possible."', '1999', '8', '30'],
> ['""now"",""is"\\\'"', 'the', '555', '""time""']]
> assert(l==valid)
> 
>