All pastes #930426 Raw Edit

Miscellany

public python v1 · immutable
·published 2008-03-06 16:19 UTC
rendered paste body
fracs = {"8x8x.3125":"8x8x5/16", "10x10x.625":"10x10x5/8", "6x6x.250":"6x6x1/4", "8x8x.500":"8x8x1/2"}f = open("c:/TEST.TXT", "r")rawlines = f.readlines()f.closefor line in rawlines:    line = line.replace('"', '')    myvar = line.split(',')    filename = 'C:/test/' + myvar[2] + '.prt'    if '.' in myvar[5]:        myvar[5] = fracs[myvar[5]]     print myvar[5]    output = open(filename, 'w')    output.write('SEC=' + myvar[4] + myvar[5] + "\n")    output.write('LEN=' + myvar[7] + "'" + myvar[8] + '"' + myvar[9] + "\n")    output.write('YGAGE=' + "\n" )    output.write('ZGAGE=' + "\n" )    output.write('WGAGE=' + "\n" )    output.write('QTY=' + myvar[3] + "\n")    output.write('TY=13/16' + "\n" )    output.write('TZ=13/16' + "\n" )    output.write('TW=13/16' + "\n" )    output.write('X1\'MC,' + myvar[2] + ',' + 'TN07-18' + "\n" )    output.close