[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Basic DTML
webmaster at zope.org
webmaster at zope.org
Thu Dec 18 17:23:55 EST 2003
A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/DTML.stx#2-4
---------------
For example, let's suppose you want to write a web page which
displays a representation of the famous "Fibonacci
sequence":http://www.mathacademy.com/pr/prime/articles/fibonac/index.asp.
You would not want to write the program that actually makes the
calculation of the Fibonacci numbers by writing DTML. It could be
done in DTML, but the result would be difficult to understand and
maintain. However, DTML is perfect for describing the page that
the results of the Fibonnacci calculations are inserted into. You
can "call out" from DTML to Script (Python) objects as necessary
and process the results of the call in DTML. For example, it is
"trivial in
Python":http://www.python.org/doc/current/tut/node6.html (search
for the word Fibonacci on this page) to implement a Fibonacci
sequence generator, and trivial in DTML to create a dynamic web
page which shows these numbers in a readable format. If you find
yourself creating complex and hard-to-understand logic in DTML,
it's likely time to explore the the Zope features which allow you
to script "logic" in Python, while letting DTML do the
presentation "dirty work".
% Anonymous User - Dec. 18, 2003 5:23 pm:
we can see the way too calculate the Fibonacci number in pythin. can tou show here formatting of it in DTML?
More information about the ZDP
mailing list