摘要: >>> f="hi,%a is a %a" #%后面只能跟同一个值 >>> v=('mac','dog') >>> f % v #最原始 "hi,'mac' is a 'dog'" >>> from string import Template >>> tmp=Template('hi, $who is a $what')#引用模块 >>> tmp.substitute 阅读全文
posted @ 2019-07-03 00:32 冲天小肥牛 阅读(278) 评论(0) 推荐(0) 编辑