You are not logged in Log in Join
You are here: Home » Members » peterbe » w2f - Write To File » dc_view

Log in
Name

Password

 
 


Dublin Core Elements

The Dublin Core metadata element set is a standard for cross-domain information resource description.
Element Description Value
Identifier resource ID http://old.zope.org/Members/peterbe/w2f
Title resource name w2f - Write To File
Description resource summary The script in itself is harmless but the idea of using it very useful. Installation Download into zope/Extensions and create a External Method object in the root with all fields filled to 'w2f'. Anywhere from Python Scripts or DTML you can call this to print information before it's taken away from you. In DTML is can be handy if you use DTML-call-RESPONSE.redirects and you won't be able to see variables value for example. In python script, if you use 'return variable' your 'print "variable is: ", variable' won't work. Also, in Python Scripts 'return printed' doesn't work if there is an error down the line. Here are some examples of how you can use it:: <dtml-let rr=getRandomX> <dtml-call "w2f(rr)"> <dtml-call "RESPONSE.redirect('http://bla bla bla')"> </dtml-let> Or as in a Python Script:: if name=="Peter": context.w2f("I am here") o=x else: context.w2f("Obviously not") o=y return o In External Methods or Python Products, this is not necessary because you can use 'print' anywhere and harmlessly read it from the stdout. The few people I know who could be bothered to try it have found it very useful for development. I find it very very useful too. Destructing the walls of debugging!
Creator resource creator ZopeOrgSite
Date default date 2001-09-11 13:21:12
Format resource format text/html
Type resource type Software Package
Subject resource keywords User Management
Contributors resource collaborators
Language resource language
Publisher resource publisher No publisher
Rights resource copyright


Additional Zope Elements

Element Description Value
CreationDate date resource created 2001-09-11 13:21:12
ModificationDate date resource last modified 2001-09-11 13:21:12
EffectiveDate date resource becomes effective None
ExpirationDate date resource expires None

Backlinks: via Google / Technorati