Personal tools
You are here: Home なごぶろ Zopeのprintedって輩のこと
About this blog
なごすいぶろぐ。「すべてはなごすいのために」。
Categories
COREBlog2 (31)
Zope (61)
Linux (26)
Misc (47)
Nagosui (11)
ReadingCOREBlog (7)
Plone (81)
Python (20)
Turbogears (18)
COREBlog1 (30)
moblog (5)
Django (12)
 
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

なんてふうにすれば…


060127-1

となるのか。「つなぐ」といってもインライン要素みたいにつなぐわけじゃないのね…。

Category(s)
Python Python
The URL to Trackback this entry is:
http://nagosui.org/Nagosui/COREBlog2/learning-python-zope-printed/tbping
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)
Enter the word