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:
> >
> >>>&
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
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
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