Document Actions
Zopeのprintedって輩のこと
ヘルプを眺めてたらprintedについて書いてあるのを発見した。
サンプルスクリプトの最後には「return printed」と書いてあって、こりゃなんだー、と思ってたところだったのだ。「print」ってのはプログラムでよく見るけど、「printed」はあんまり見ないからなぁ。
Because the "print" statement cannot operate normally in Zope, its effect has been changed.
で、結局、
The special builtin name "printed" evaluates to the concatenation of all text printed so far during the current execution of the script.
ということらしい。要するに、いろいろprintしたものをつないでそいつら全部をまとめちゃうわけね。ということは、
print "このスクリプトのタイトルは"
print script.title
print "なんですよ。マジで。"
return printed
なんてふうにすれば…
となるのか。「つなぐ」といってもインライン要素みたいにつなぐわけじゃないのね…。
- Category(s)
-
Python
- The URL to Trackback this entry is:
- http://nagosui.org/Nagosui/COREBlog2/learning-python-zope-printed/tbping

