LehreWiki

   1 import os,sys
   2 datadir='Desktop/'
   3 files=os.listdir(datadir)
   4 size=0
   5 for file in files:
   6    size +=os.path.getsize(datadir+file)
   7 print size

   1 import os,glob
   2 directory='satbildverarbeitung2' #Hier gewünschtes Verzeichnis angeben
   3 files=glob.glob('directory/*.*')
   4 for i in files:
   5     size=os.path.getsize(i)
   6     print i,size

LehreWiki: SiaExercisesLesson3LoesungSystem (last edited 2008-04-28 13:38:28 by NinaMaass)