Changes between Version 4 and Version 5 of Tutorials/ControllingDataOutput

Show
Ignore:
Timestamp:
09/21/08 01:51:14 (5 years ago)
Author:
mturk
Comment:

replaced list comprehension with generator expression; slightly faster, definitely more memory conservative

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/ControllingDataOutput

    v4 v5  
    7474hierarchy = 'RD0033.hierarchy' 
    7575old, new = '/dsgpfs/harkness/NewL7/Dumps/RD0033/','/gpfs/ux455215/L7/RD0033/' 
    76 new_lines = [line.replace(old, new) for line in open(hierarchy)] 
     76new_lines = (line.replace(old, new) for line in open(hierarchy)) 
    7777open("%s.new" % hierarchy).writelines(new_lines) 
    7878}}}