Python论坛  - 讨论区

标题:[python-chinese] 如何在webpy的模板中定义变量

2007年12月07日 星期五 14:09

faitherq faitherq在163.com
星期五 十二月 7 14:09:02 HKT 2007

todos= [[1,2,3,4],[1,2,3,4],[1,2,3,4]]
ÎÒдµÄÄ£°åÈçÏ£º 



$var idx: 0
  

$for todo in todos:
 $if self.idx:
  
  %self.idx += 1
 $else:
  
    $for x in todo:
     $x
     


ÔËÐв»Õý³£self.idx += 1 ÎÞ·¨Ö´ÐС£ ·¢ÏÖwebpyËäÈ»¼òµ¥£¬µ«ÊÇÎĵµºÜÉÙ¡£


2007-12-07 



faitherq 
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071207/1b080d80/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月07日 星期五 14:28

大郎 iexper在gmail.com
星期五 十二月 7 14:28:58 HKT 2007

                

²Î¿¼ On Dec 7, 2007 2:09 PM, faitherq <faitherq在163.com> wrote: > todos= [[1,2,3,4],[1,2,3,4],[1,2,3,4]] > ÎÒдµÄÄ£°åÈçÏ£º > > > > $var idx: 0 > > > $for todo in todos: > $if self.idx: > > %self.idx += 1 > $else: > > $for x in todo: > $x > > > > ÔËÐв»Õý³£self.idx += 1 ÎÞ·¨Ö´ÐС£ ·¢ÏÖwebpyËäÈ»¼òµ¥£¬µ«ÊÇÎĵµºÜÉÙ¡£ > > > 2007-12-07 > ------------------------------ > faitherq > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- http://del.icio.us/iexper http://twitter.com/qichangxing http://webpy.org Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071207/61ea041c/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月07日 星期五 14:57

faitherq faitherq在163.com
星期五 十二月 7 14:57:31 HKT 2007

¸ã¶¨ÁË£¬Ð»Ð»´óÀÉ¡£

webpyµÄÄ£°å£¬¶Ô¿Õ¸ñÕæÊÇҪעÒâ¡£




2007-12-07 



faitherq 



·¢¼þÈË£º ´óÀÉ 
·¢ËÍʱ¼ä£º 2007-12-07  14:29:43 
ÊÕ¼þÈË£º python-chinese在lists.python.cn 
³­ËÍ£º 
Ö÷Ì⣺ Re: [python-chinese]ÈçºÎÔÚwebpyµÄÄ£°åÖж¨Òå±äÁ¿ 
 
                

²Î¿¼ On Dec 7, 2007 2:09 PM, faitherq <faitherq在163.com> wrote: todos= [[1,2,3,4],[1,2,3,4],[1,2,3,4]] ÎÒдµÄÄ£°åÈçÏ£º $var idx: 0 $for todo in todos: $if self.idx: %self.idx += 1 $else: $for x in todo: $x ÔËÐв»Õý³£self.idx += 1 ÎÞ·¨Ö´ÐС£ ·¢ÏÖwebpyËäÈ»¼òµ¥£¬µ«ÊÇÎĵµºÜÉÙ¡£ 2007-12-07 faitherq _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://del.icio.us/iexper http://twitter.com/qichangxing http://webpy.org Gtalk: iexper(at)gmail.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071207/bf2e341d/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号