Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2008-04-28 13:22:41
Size: 172
Editor: NinaMaass
Comment:
Revision 4 as of 2008-04-28 13:29:40
Size: 155
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
{{{#!python import os,sys
Line 3: Line 3:
import os,glob datadir='Desktop/'
Line 5: Line 5:
directory='satbildverarbeitung2'
files=glob.glob('directory/*.*')
for i in files:
    size=os.path.getsize(i)
    print i,size
files=os.listdir(datadir)
Line 11: Line 7:
}}} size=0

for file in files:

   size +=os.path.getsize(datadir+file)

print size

import os,sys

datadir='Desktop/'

files=os.listdir(datadir)

size=0

for file in files:

  • size +=os.path.getsize(datadir+file)

print size

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