[Tutor] My first program (fwd)

Daniel Yoo dyoo@hkn.EECS.Berkeley.EDU
Sun, 10 Sep 2000 01:36:25 -0700 (PDT)


I'll forward your questions to the other people on tutor@python.org.  
(Someday, I must learn how to get my pine emailer to do the reply-to thing
properly.)

I remember hearing about XML specific stuff for Python.  Supposedly, there
are very good tools to parse XML nicely.  You might want to keep an eye
out for them.

It should be ok to embed the ANSI into your file.  Does anyone else have
experience dealing with ANSI programs?

Good luck with your program.


---------- Forwarded message ----------
Date: Sat, 9 Sep 2000 22:20:09 -0400
From: Paul Yachnes <paul.yachnes@netzero.net>
To: Daniel Yoo <dyoo@hkn.EECS.Berkeley.EDU>
Subject: Re: [Tutor] My first program

Daniel,

Thank you for your quick reply. I had tried the first suggestion using a for
loop, beginning:

for line in oldfile.readlines():

but had left in the following line:

line = oldfile.readline()

so of course it didn't work. I don't know why I made this mistake; this loop
is really a lot like my second loop.

I want to be able to use this program on extremely large XML files, and I
was a bit concerned with using the readlines() method. So I am very happy to
see your second suggestion which I will try if I run into memory problems.
Thanks again. With help like this, I'm much more hopeful about being able to
learn this stuff "on my own."

As far as sending it off to the Vaults of Parnassus, I have some questions
about its general usefulness. Since I intended it to process XML, I left out
the characters that can be displayed without problem by Web browsers (I may
add a few more), and I also left out angle brackets, "<" and" >", since you
wouldn't want to convert these in your XML document. So people would need to
be aware of this. Also, is it legitimate to use the actual ANSI
characters
in the program (i.e. is this a legitimate cross-platform approach) or should
I be referring to them by number (how do you do this in Python)? If you have
any thoughts on this, I'd greatly appreciate it!

Paul