Differences between revisions 2 and 6 (spanning 4 versions)
Revision 2 as of 2008-04-28 13:23:44
Size: 210
Editor: NinaMaass
Comment:
Revision 6 as of 2008-04-28 13:33:26
Size: 313
Editor: NinaMaass
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
import os,glob import os,sys
datadir='Desktop/'
files=os.listdir(datadir)
size=0
for file in files:
   size +=os.path.getsize(datadir+file)
print size
}}}
Line 4: Line 11:
directory='satbildverarbeitung2'  #Hier gewünschtes Verzeichnis angeben {{{#!python
directory='satbildverarbeitung2'
Line 9: Line 17:

   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 directory='satbildverarbeitung2'
   2 files=glob.glob('directory/*.*')
   3 for i in files:
   4     size=os.path.getsize(i)
   5     print i,size

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