[Zope] [Python/Zope]how to open a "File"
Rakotomandimby M. A.
mrakotom at free.fr
Wed Nov 5 01:35:33 EST 2003
Hi all ,
I'm running Zope 2.6.2 (binary) on a Linux box.
I FTP-uploaded to the server (into the Site root) a file named "foo".
The file has been added as a File Object ( no problem for that ) .
This file content a single line ended by a '\n' , wich is an IP address(
no problem for that either )
I wrote a very simple python Script that should return the line inside
that file _without_ the final '\n' :
import string
fichier = open('ancienne_ip','r')
ip = fichier.readline()
ip = string.strip(ip)
return ip
the problem is that i got error for this :
Error Type: NameError
Error Value: global name 'open' is not defined
What did i do wrong ?
Thnak you .
More information about the Zope
mailing list