#!/usr/bin/python outFile = open( "flagHeaderFile.h", 'w' ) for i in range(1,2000): outString = "evflag fakeEventFlag__"+str(i)+";\n" outFile.write( outString ) outFile.write("\n") outFile.close()