#!/usr/bin/env python

import sys
import pylauncher

if len(sys.argv)!=4:
    print "Usage: make_commandlines.py njobs tmin tmax"
prog,njobs,tmin,tmax = sys.argv

cfile = open("commandlines","w")
cfile.write("####\n");
cfile.write("#### This file was automatically generated by: \n");
cfile.write("#### python %s %s %s %s\n" % (prog,njobs,tmin,tmax));
cfile.write("####\n");
for i,c in zip( range(int(njobs)),pylauncher.SleepCommandGenerator(tmin=int(tmin),tmax=int(tmax))):
    cfile.write( c+"\n" )
cfile.close()

print "Written file `commandlines'"
