Python 字符串模板

来源:互联网 发布:电脑网络共享怎么设置 编辑:程序博客网 时间:2024/06/05 06:44
from string import Template #string文件导入Templateprint(type(Template))mystr=Template("hi,$name  你是  $baby")print(mystr.substitute(name="张三",baby="lovely baby"))

原创粉丝点击