文書操作
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
なんてふうにすれば…
となるのか。「つなぐ」といってもインライン要素みたいにつなぐわけじゃないのね…。
- カテゴリ
-
Python
- 固定リンク
- ¦
- コメント (0)
- ¦
- トラックバック (0)
- トラックバック用URL:
- http://nagosui.org:8080/Nagosui/COREBlog2/learning-python-zope-printed/tbping

