#- 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()
---------------------------------------------------------------------------
hello = T("Hello,<#username#>")
message = T("please input welcom message:")
program = T(""" message = input_raw("<#message#>")
print "<#hello#>,",message""")
阅读(696) | 评论(0) | 转发(0) |