#------------------------------------------------------------------------------- # Name: Notes # Purpose: # # Author: Kelvin # # Created: 27/11/2013 # Copyright: (c) Kelvin 2013 # Licence: #------------------------------------------------------------------------------- # Initialise the empty Dictionary. params = {}; # Open the given parameter file. paramfile = open('/u/hsu004/IntroToDuchamp/duchampHIPASS.in') # Load files for lines of parameter data in the specified format and # store them into the dictionary. for line in paramfile: if line[0] != '#' and len(line) > 1: linebits = line.split() params[linebits[0]] = linebits[1] print(params); params['threshold'] = 0.05; newfile = open('/u/hsu004/Kelvin/duchampHIPASSedited.in', 'w') for par in params: print(par, params[par]); for par in params: newfile.write('%s %s\n'%(par, params[par])); newfile.close();