Re: sort a list

2007-10-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > hello, > > I'm new to python and this list.I hope this question don't repeat an old > story on the list. > > I have a number list,say it's [3,2,1,4,5],I want to sort it as > [1,2,3,4,5],how to do? your_list.sort() Please read the documentation, all of this is prop

Re: sort a list of files

2006-05-06 Thread Scott David Daniels
Ryan Forsythe wrote: > Gary Wessle wrote: >> Hi >> >> I am trying to print out the contents of a directory, sorted. > ... >> if I remove ".sort()" at the end of line 6 I get an unsorted list of >> files, if I leave it I get None. who do I fix this? > > `blah.sort()` sorts in-place and returns None

Re: sort a list of files

2006-05-06 Thread Ryan Forsythe
Gary Wessle wrote: > Hi > > I am trying to print out the contents of a directory, sorted. ... > if I remove ".sort()" at the end of line 6 I get an unsorted list of > files, if I leave it I get None. who do I fix this? `blah.sort()` sorts in-place and returns None. You probably want sorted(blah)