partial string formatting

前端 未结 21 1096
野的像风
野的像风 2020-11-28 04:30

Is it possible to do partial string formatting with the advanced string formatting methods, similar to the string template safe_substitute() function?

F

21条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 05:15

    If you're doing a lot of templating and finding Python's built in string templating functionality to be insufficient or clunky, look at Jinja2.

    From the docs:

    Jinja is a modern and designer-friendly templating language for Python, modelled after Django’s templates.

提交回复
热议问题