OT: unix newbie questions

Fredrik Lundh fredrik at pythonware.com
Tue Jun 6 02:41:05 EDT 2006


Fredrik Lundh wrote:

>> *24. Display recent 10 java files, (with *.java extension) , in 
>> descending order by time, latest to oldest time. (1) *
> 
>  >>> files = sorted(glob.glob("*.py"), key=os.path.getmtime)[-10:]
>  >>> files.reverse()

(to display the files, use print)

</F>




More information about the Python-list mailing list