[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Basic Zope Objects

webmaster at zope.org webmaster at zope.org
Thu Dec 18 17:32:49 EST 2003


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/BasicObject.stx#3-43

---------------

      Replace the original content that comes in the "body" (the big
      TEXTAREA) of the Script (Python) object with the following
      text::

         return 'Hello, %s from the %s script' % (name, script.id)

        % Anonymous User - Dec. 18, 2003 5:32 pm:
         let's explain it - at least, i'll try.
         the %s "directive" says to python: change me with the next variable you find after this string, and format it
         as a string too.
         so, the first %s is changed into the string named name , and the second one with the string named script.id.

         note that combining T variables in a (var1, var2, ..., ..., varT) creates a "tuple" - something like a list.

         i hope i've been helpful.



More information about the ZDP mailing list