[Tutor] Bundle help!

Sara Johnson sarliz73 at yahoo.com
Sun Jul 15 19:16:51 CEST 2007


Thanks to everyone for your help and quick responses!
   
  Has anyone heard of the "bundle method?"  Some of you have already said you didn't.  I wonder why it's included as part of my code/instructions.  I'm trying to accomplish what I 'think' they want with the other questions I've posed here.
   
  Here's my instruction:
  ================
  #SUB-TASK 1: Fix the above to print/write only the keys with >0% missing, sorted alphabetically
#by the key. (No need to use the "bundle method" for that).  But ALSO append the
#same information to outfile2, sorted by worst offender. (Use bundle for that).
========================
   
  Just curious, but in this link (' http://xahlee.org/perl-python/sort_list.html ') you mentioned, what does the "re" part mean?  At first I thought it was the name of the list or 'return' but that's included later.
   
   
  ***************
   
  def myComp (x,y):
    import re
    def getNum(str): return float(re.findall(r'\d+',str)[0])
    return cmp(getNum(x),getNum(y))

li.sort(myComp)
print li # returns ['web7-s.jpg', 'my23i.jpg', 'fris88large.jpg', 'my283.jpg']

  Thanks,
  Sara
   
  *********
  
David Perlman <dperlman at wisc.edu> wrote:
  Maybe this reference will help:
http://xahlee.org/perl-python/sort_list.html
Just the first part of the discussion there.


 
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070715/3e649aaa/attachment.html 


More information about the Tutor mailing list