def skip_leading_wsp(f):
 return StringIO('\n'.join(map(string.strip, f.readlines())))

def skip_leading_wsp ( f ) : return StringIO ( '\n' . join ( map ( string . strip , f . readlines ( ) ) ) )
works on a file .