Alan Gauld wrote: > "Scott Oertel" <[EMAIL PROTECTED]> wrote >> Do you have any good documentation that could shed some more light >> on >> exactly how to use format strings in such a way? > > The docs contain the basic documentation
http://docs.python.org/lib/typesseq-strings.html > # there's a slightly better way to do this which I can't recall right > now! > # %% -> literal %, > # %s = insert string > # so %%%ss -> %Xs where X is the inserted data > fmtStr = "%%%ss\t%%%ss%%%ss" % (max_width, max_width, max_width) > > print fmtStr % tuple(data) I think you are looking for * as a width specifier which takes the width from the argument list though it might be a bit awkward in this case where the length of the argument list varies. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor