I am importing lines from an external csv file and when I iterate through the lines and increment, new lines are introduced. How would I cut out the newlines. I have attempted several pythonic strip() and rstrip() how can i implent this?
import sys, os f=open('europe_csv') lines=f.readlines() BU = 'Company,,,,,,,,,,,,,,' PPP = 'Pre-Prod,,,,,,,,Prod,,,,,,' C1 = ',,,,,,,,,,,,,,' Title = 'Site,Environment,' NET1 = lines[4] GW1 = lines[5] M1 = lines[6] PS1 = lines[7] PE1 = lines[8] C2 = ',,,,,,,,,,,,,,' NET2 = lines[10] GW2 = lines[11] M2 = lines[12] PS2 = lines[13] PE2 = lines[14] for count in range(64, 127): print NET1.format(count) print GW1.format(count) print M1 print PS1.format(count) print PE1.format(count) print C2 print NET2.format(count) print GW2.format(count) print M2 print PS2.format(count) print PE2.format(count) -- http://mail.python.org/mailman/listinfo/python-list