立即学习:https://edu.csdn.net/course/play/26755/340104?utm_source=blogtoedu
Template对象封装,$放置一些占位符,并通过substitute方法用实际的值替换这些占位符:
template1 =Template('$s是最好的语言)
print(template1.substitute(s='python')
立即学习:https://edu.csdn.net/course/play/26755/340104?utm_source=blogtoedu
Template对象封装,$放置一些占位符,并通过substitute方法用实际的值替换这些占位符:
template1 =Template('$s是最好的语言)
print(template1.substitute(s='python')