Sorting large files

Jeff jam at quark.emich.edu
Wed Dec 22 13:58:33 EST 1999


On Wed, Dec 22, 1999 at 01:50:31PM -0500, Edward C. Jones wrote:
> A Python program of mine generates a large number of tuples of
> ten integers each. I need to sort this collection of tuples. If
> there weren't so many tuples, I could make a Python list of these
> tuples and use sort(). Currently I write the tuples out to a file
> in ASCII and use the UNIX sort command. Is there a faster way to
> sort these tuples? Sort them in blocks using Python then merge
> using the UNIX sort? Are there any faster sort programs (perhaps
> in database systems)?
> 

greetings,

it really depends on what exactly you are trying to do. if you want to sort
a tuple of length 10, convert it to a list, run the sort() method, and then
convert it back to a tuple... but that's the easy part. what does the data
look like? could you post a sample?

regards,
J
-- 
|| visit gfd <http://quark.emich.edu/>
|| psa member -- <http://www.python.org/psa/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>




More information about the Python-list mailing list