[Zope] File I/O in Zope

csnorville@fedex.com csnorville@fedex.com
Mon, 12 Nov 2001 11:56:29 -0700


This is a multipart message in MIME format.
--=_alternative 00680C1E87256B02_=
Content-Type: text/plain; charset="us-ascii"

Hi Everyone, 

I am fairly new to Zope and I need some assitance on something that I know
is fundamental so please don't beat up on me too bad ;-)

I am try to open a file with a Python Script in Zope for content 
manipulation. This
is a text file, I basically want to read a number, operate on it and write 
it back out. 
However when I try to get my file handle I get;

file=open("/home/chris/misernumber", "r+")

Zope Error

           Zope has encountered an error while publishing this resource.
           Error Type: NameError
           Error Value: global name 'open' is not defined

I tried creating the file as a Zope object but I get the same error. Again 
I know this
is fundamental. If ya'll can help me with this, or at least point me to 
some documentation
it would be deeply appreciated. 

Thanks,

Chris

--=_alternative 00680C1E87256B02_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Hi Everyone, </font>
<br>
<br><font size=2 face="sans-serif">I am fairly new to Zope and I need some assitance on something that I know</font>
<br><font size=2 face="sans-serif">is fundamental so please don't beat up on me too bad ;-)</font>
<br>
<br><font size=2 face="sans-serif">I am try to open a file with a Python Script in Zope for content manipulation. This</font>
<br><font size=2 face="sans-serif">is a text file, I basically want to read a number, operate on it and write it back out. </font>
<br><font size=2 face="sans-serif">However when I try to get my file handle I get;</font>
<br>
<br><font size=2 face="sans-serif">file=open(&quot;/home/chris/misernumber&quot;, &quot;r+&quot;)</font>
<br>
<br><font size=2 face="sans-serif">Zope Error</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Zope has encountered an error while publishing this resource.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Error Type: NameError</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Error Value: global name 'open' is not defined</font>
<br>
<br><font size=2 face="sans-serif">I tried creating the file as a Zope object but I get the same error. Again I know this</font>
<br><font size=2 face="sans-serif">is fundamental. If ya'll can help me with this, or at least point me to some documentation</font>
<br><font size=2 face="sans-serif">it would be deeply appreciated. </font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br>
<br><font size=2 face="sans-serif">Chris<br>
</font>
--=_alternative 00680C1E87256B02_=--