[Zope] Write the time to a text file

J. Cameron Cooper jccooper at jcameroncooper.com
Mon Nov 3 22:30:08 EST 2003


>from a python script I want to write a new line containing the current time to 
>a text file. The textfile is contained in the ZODB.
>How can I do that?
>
There's no such thing in the ZODB. But there are Files with the type 
text/plain. I can't get why, but if you really want to, the API for 
adding a file is in the online Zope help under Zope Help > API Reference 
 > File

Take a look at the addEntry script in the GuestBook example.

http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SimpleExamples.stx

You could also do something like

http://www.zopelabs.com/cookbook/990792795

which fakes having a file.

             --jcc

-- 
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."





More information about the Zope mailing list