On 9/28/2010 7:12 AM Norman Khine said...
thanks for the reply, i think i have it now, perhaps it could be done better
I think I'd use a helper function to sort:
def sortOtherToEnd(val):
if val['name'] == 'other:
return 'zzzz'
return val['name']
#then sort it
topics.sort(key=sortOtherToEnd)
But, generally, I'd stop once I got it going without worrying too much
about 'better' ways -- that's a subjective measure. There is often one
obvious way to do it, but unless you've seen that way before, there'll
often be many alternatives that work as well.
HTH,
Emile
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor