1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] partial string formatting

Discussão em 'Python' iniciado por Stack, Dezembro 7, 2024.

  1. Stack

    Stack Membro Participativo

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

    For example:

    s = '{foo} {bar}'
    s.format(foo='FOO') #Problem: raises KeyError 'bar'

    Continue reading...

Compartilhe esta Página