[Patches] fileinput.py argument handling (and suggestion)

Skip Montanaro skip@mojam.com (Skip Montanaro)
Sun, 9 Apr 2000 08:57:59 -0500 (CDT)


    Greg> fileinput.input(strip=fileinput.STRIP_NL)
    Greg> fileinput.input(strip=fileinput.STRIP_ALL)

    Guido> fileinput.input(strip=1)?

    Guido> But I think this is going too far.

Agreed.  "chop" is a special case where you have to detect different line
termination cases on a platform-specific basis.  Plain old line stripping is 
handled just fine by existing functions.

Speaking of chop, If I am on a platform X box (X in Unix, Windows, Mac, Be)
and try to fileinput.input(chop=1) a file from a different box, will it do
the right thing (e.g. recognize ^M as a line termination character on a Unix 
or Windows machine)?

-- 
Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/