Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] running python script



On Aug 31, 2004, at 12:24, Shawn wrote:

> The files which were written under *nix had a windows line ending, but 
> apparently the app using them expected that.  Looking at the script 
> though...seemed ok.
>
> I guess the best would have been for the original writer to just have 
> checked the last two chars of the line and it would work for both.

Another alternative would have been to open the files with 
open("filename.txt", 'rU') which puts the file object into "universal 
newline mode."   That attempts to hide DOS, Macintosh, and Unix line 
endings from you... making them all into '\n'.


-- 
Jim Tittsler  7J1AJH/AI8A                            GPG: 0x01159DB6
Kanto Computer Calendar  http://www.OnJapan.net/calendar/
Python Starship          http://Starship.Python.net/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links