added unique naming of output file

This commit is contained in:
Philip Eisenlohr 2012-05-07 20:36:58 +00:00
parent a84838d3ba
commit 34ef08c762
1 changed files with 3 additions and 1 deletions

View File

@ -68,7 +68,9 @@ if filenames == []:
else: else:
for name in filenames: for name in filenames:
if os.path.exists(name): if os.path.exists(name):
files.append({'name':name, 'input':open(name), 'output':open(os.path.splitext(name)[0]+'_binned'+os.path.splitext(name)[1],'w')}) files.append({'name':name, \
'input':open(name), \
'output':open(os.path.splitext(name)[0]+'_binned%i-%i'%(options.data[0],options.data[1])+os.path.splitext(name)[1],'w')})
# ------------------------------------------ loop over input files --------------------------------------- # ------------------------------------------ loop over input files ---------------------------------------