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

[email protected]
Newsgroups gmane.comp.web.zope.zdp
Message-ID <[email protected]>
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.

_______________________________________________
ZDP maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zdp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.