problem with f.readline()?

Posted by kaushik on Stack Overflow See other posts from Stack Overflow or by kaushik
Published on 2010-05-27T04:55:01Z Indexed on 2010/05/27 5:01 UTC
Read the original article Hit count: 110

Filed under:
|

I am reading one line at a time from a file, but at the end of each line it adds a '\n'.

example: line is: 094 234 hii
but my input is: 094 234 hii\n

I want to read line by linem but I don't need to keep the newlines...

My goal is to read a list from every line: I need ['094','234','hii'], not ['094','234','hii\n']

Any advice?

© Stack Overflow or respective owner

Related posts about python

Related posts about file-io