from string import Template
print(type(Template))
mystr = Template("hi,$name 你是$baby")
print(mystr.substitute(name = "边真", baby = "lovely "))

输出

# 结果
<class 'string._TemplateMetaclass'>
hi,边真 你是lovely 

 

相关文章:

  • 2022-12-23
  • 2022-01-19
  • 2021-11-05
  • 2021-09-12
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-13
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案