import os from string import zfill def command(str) : x = os.system(str) if x != 0 : raise Exception def readlines(filename) : f1=open(filename) lines=f1.readlines() f1.close() return lines def NZname(N,Z,str) : Zs=zfill(Z,3) Ns=zfill(N,3) NZs=Ns+'.'+Zs return NZs+str def path_to(N,Z) : # with trailing '/' Zs=zfill(Z,3) Ns=zfill(N,3) NZs=Ns+'.'+Zs return Zs+'/'+NZs+'/'