Question :
rstrip not removing newline char what am I doing wrong? [duplicate]
Pulling my hair out here… have been playing around with this for the last hour but I cannot get it to do what I want, ie. remove the newline sequence.
def add_quotes( fpath ):
ifile = open( fpath, 'r' )
ofile = open( 'ofile.txt', 'w' )
for line in ifile:
if line == 'n':
ofile.write( "nn" )
elif len( line ) > 1:
line.rstrip('n')
convertedline = """ + line + """", ""