Re: [Cheetahtemplate-discuss] Strange Output Ordering
Brought to you by:
rtyler,
tavis_rudd
From: Mike O. <ms...@oz...> - 2005-02-24 07:39:03
|
Miles Stoudenmire wrote: >Please help me figure out this problem. It may be that it's 2am, but I >don't think I'm doing anything wrong here... > >First, I wrote this class: > >SomeClass.py ------------ > >class SomeClass(object): > def print_times(self,s,num): > print str(s)*num > > return str(s)*num # Not print. Anything the function prints gets sent to standard output separately; it's not part of the template. The template is not output until it's entirely filled, hence it comes afterward. If you look in a .py template module, you'll see that templates and #def methods collect the output in a StringIO and then return it. |