
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] running python script
> Well so much for believing what I read
Wow, isn't that the truth! Got a Python script for windows running on *nix by changing from:
if line == "\n":
z += 1
#this looks to me like it would catch the end of a *nix file line, but wasn't catching them for some reason
to:
if line=="\r\n":
z+= 1
#what the "#$%, why do I need to check for a windows line end
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.
--
Shawn
Karma is immutable, so act accordingly!
Home |
Main Index |
Thread Index