> The line that Ive been writing (of course wrong > script): > > f1 = open('myfile','r') > stuff = f1.read().split('\n') > for i in stuff: > if i != '//': > trcode = line.split('\t')[0] > trquant = line.split('\t')[1] > print trcode+'\t'+trquant >
You use i in the for loop but line in the code block inside? try for line in file('myfile'): if line != '\\': trcode = line.split('\t')[0] etc... HTH, Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor