| Size: 156 Comment:  |  ← Revision 3 as of 2008-11-24 09:54:06  ⇥ Size: 637 Comment:  | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 5: | Line 5: | 
| abgeschrieben von Gruppe 1 - klappt aber leider nicht! {{{#!python #!/usr/bin/env python import os,fnmatch,sys dir,ext= 'pf/u/u241127/', '.*' fileList=[] for root, dirs, files in os.walk(dir): f=fnmatch.filter(files,'*.'+ext) if type(f)==type([]): for fi in f: fName=root+os.path.sep+fi fSize=os.path.getsize(fName) fileList.append([fSize,fName]) fileList.sort() fileList.reverse() print fileList }}} | 
abgeschrieben von Gruppe 1 - klappt aber leider nicht!
   1 #!/usr/bin/env python
   2 import os,fnmatch,sys
   3 
   4 dir,ext= 'pf/u/u241127/', '.*'
   5 
   6 fileList=[]
   7 for root, dirs, files in os.walk(dir):
   8     f=fnmatch.filter(files,'*.'+ext)
   9     if type(f)==type([]):
  10         for fi in f:
  11             fName=root+os.path.sep+fi
  12             fSize=os.path.getsize(fName)
  13             fileList.append([fSize,fName])
  14 fileList.sort()
  15 fileList.reverse()
  16 
  17 print fileList
