Creating custom formatter function

2009-02-16 Thread Garrett Cooper
Hello Python folks, I have a function where I'd like to prefix a format string via a `prefix' string. The definition of the base method is as follows: #START CODE def print_message(prefix, out_stream, fmt, *args, **kwargs): Print out [prefix]: [message] message = fmt if 0

Re: Creating custom formatter function

2009-02-16 Thread Alan G Isaac
On 2/16/2009 6:50 AM Garrett Cooper apparently wrote: I was wondering what the proper means was for formatting strings. http://docs.python.org/library/string.html#string-formatting http://docs.python.org/library/string.html#template-strings

Re: Creating custom formatter function

2009-02-16 Thread Terry Reedy
Garrett Cooper wrote: Hello Python folks, I have a function where I'd like to prefix a format string via a `prefix' string. The definition of the base method is as follows: #START CODE def print_message(prefix, out_stream, fmt, *args, **kwargs): Print out [prefix]: [message]