[Zope] Getting data from a file.

Ronald L. Chichester complaw@hal-pc.org
Sat, 29 Dec 2001 08:01:26 -0600


I have a text file loaded into Zope (2-4-3) as a File object.  I want to
"read" the file and do something with the information therein.  Ideally,
I would want to go through each line of data using a python script. 
However, the following doesn't work...

import string

lines = context.myFileObject.data

for line in lines:
  # do something


...in fact, all it really does is make the Zope web interface act very
slowly.

The question is, how do you get at each line of text data from a File
object.

Anyone know how to do that (properly)?

The alternative is to conver the input text data directly into XML and
then have Zope import that.  Is that possible?  Is there a special way
that you have to import it?  Has anyone ever done that before (or is
this worse than the above solution)?

Cheers,

Ron