Newlines are handled differently on Unix/Windows/Mac.
The plucker distribution tends to assume unix, which makes the code almost
unreadable under windows. In the past, I've either used MSVC, or gone
through and changed the linebreaks by hand. Using MSVC, I get a mixture of
the two newline types, which probably isn't good. Doing it by hand is slow
and error-prone. (And this makes me reluctant to upgrade to the "standard"
distribution, for fear of losing my own changes again.)
Today, I got sufficiently fed up to see if python could handle this for me;
it can. Newer versions of python have a "universal newline", so that it
reads correctly. If you don't specify binary, it will even convert the
lines for you behind the scenes... then write them back out in the converted
format.
Wish I'd tried this earlier...
def fixlinebreak(inf=r"C:\Python23\Tools\PyPlucker\TextParser.py",
outf=r"C:\Python23\Tools\PyPlucker\TextParser2.py"):
src=open(inf, "r")
out=open(outf,"w")
line = src.readline()
while line:
out.write(line)
line = src.readline()
src.close()
out.flush()
out.close()
_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev