import random outf = open("out.table","w") channel = 0 for module in range(1,48+1): for layer in range(1,4+1): for sector in range(1,4+1): for end in range(0,1+1): #outf.write("{} {} {} {} {}\n".format(module,layer,sector,end,channel)) outf.write("{} {} {} {} {}\n".format(module,layer,sector,end,random.uniform(0,1))) channel += 1 outf.close()