[Zope] How do I write to a text file from Python?
Jakob Schou Jensen
schou.temp.1 at gmail.com
Tue Sep 2 03:25:12 EDT 2008
Hi Dieter
By file object I meant the "OFS.Image.File" kind. I had two problems
creating and modifying the file (at least). The first was that the
manage_addFile() function that you mention seemed to insist on a os-file
like object for the "file" parameter. I got some kind of seek error when
trying to supply a string. But I might have done something else wrong.
Appart from that I got a security error when I called the File.update_data()
function. Using external methods I could call update_data() and import the
StringIO python module that allows creating of string based file which I
could in turn pass on to manage_addFile().
Well ... it works ... there may be a simpler way as you suggest. If you have
some sample code I would like to see it. I am using zope 2.4.something.
Thanks,
Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20080902/d134f515/attachment.html
More information about the Zope
mailing list