Skip to content Skip to sidebar Skip to footer

Pass *args To String.format In Python?

Is it possible to pass *args to string.format? I have the following function: @classmethod def info(cls, component, msg, *args): '''Log an info message''' cls.__log(cls.Lev

Solution 1:

I think what you want to do is

msg.format(*args)

Solution 2:


Post a Comment for "Pass *args To String.format In Python?"