Re: Sorting Multidimesional array(newbie)

2006-12-14 Thread Brian Mills
Fredrik Lundh wrote: > Brian Mills wrote: > > > There's another (IMHO more readable) way to do it if you can afford > > defining a short little "compare" function, and telling .sort() > > to use that instead of its default: > > > >>>&

Re: Sorting Multidimesional array(newbie)

2006-12-11 Thread Brian Mills
There's another (IMHO more readable) way to do it if you can afford defining a short little "compare" function, and telling .sort() to use that instead of its default: >>> def myListCmp(lst1, lst2): ... if lst1[0] < lst2[0]: return -1 ... if lst2[0] > lst2[0]: return 1 ... return 0 ... >>> a

Re: Printing Hidden Character in Python

2006-10-27 Thread Brian Mills
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Thursday 26 October 2006 16:43, Wijaya Edward wrote: > > How can we print out the hidden character like > > "\n", "\r" etc in Python? > > If it's meant to evidentiate then you

Re: Newbie programmer question: How do parsers work?(Python examples?)

2006-08-25 Thread Brian Mills
You have a lot of choices with this sort of thing. What you'd use depends largely on what sorts of files/input you'll be parsing. For example, a common machine-friendly data format is the comma-separated file. These, or really any file which uses a character-based field seperator (including newl