Python_string.Template_格式化字符串

参考:https://www.cnblogs.com/testlearn/p/14813688.html

 

spug用法

spug_api/libs/utils.py

# 字符串模版渲染
def render_str(template, datasheet):
return Template(template).safe_substitute(datasheet)
posted @ 2023-03-25 16:44  FrantiChow  阅读(32)  评论(0)    收藏  举报