Chinaunix首页 | 论坛 | 博客
  • 博客访问: 576676
  • 博文数量: 226
  • 博客积分: 10080
  • 博客等级: 上将
  • 技术积分: 1725
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-26 11:15
文章分类

全部博文(226)

文章存档

2011年(5)

2010年(64)

2009年(99)

2008年(37)

2007年(21)

我的朋友

分类:

2010-03-02 19:13:21

#- coding: UTF-8 -*-
#Author: David(http://blog.chinaunix.net/u1/55091/article_0_2.html)
#Created Time: 2010-03-02 19:02:53
#File Name:MeteorTest2.py
#Description:
#---------------------------------------------------------------------
from meteor import Template
if __name__ == '__main__':
    vars = {'program':{'hello':{'username':'David'}}}
    template = Template()
    template.load('ex02.py','python')
    DotFile = open('meteor2.dot','w+')
    #生成dot文件,可以由此文件产生图形
    #dot -Tgif meteor2.dot -o meteor2.gif 
    #当然你要下载Graphviz软件
    template.writeDot(DotFile)
    print template.value('program',vars)
    DotFile.close()
 
---------------------------------------------------------------------------
 
#- coding: UTF-8 -*-
#Author: David(http://blog.chinaunix.net/u1/55091/article_0_2.html)
#Created Time: 2010-03-02 18:59:03
#File Name:ex02.py
#Description:
#---------------------------------------------------------------------
from meteor import T
hello = T("Hello,<#username#>")
message = T("please input welcom message:")
program = T(""" message = input_raw("<#message#>")
 print "<#hello#>,",message""")
阅读(654) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~