python 2 read file ignore spaces at the start and end code example Example: strip whitespace python >>> s.strip() 'Hello World From Pankaj \t\n\r\tHi There'