splitString output as argument to string format fails?

U-CDK_CHARLES\Charles "Charles Krug" at cdksystems.com
Wed Mar 24 13:23:21 EST 2004


List:

I'm trying to pull comma delimited data from a file, then format for
display in a listBox.  I'm using string.split()

When I do:

    print string.split(myInputLine, ',')

I get something like:

['Mon Mar 22 09:37:28 2004', ' <cbLogger>', ' -- Log opened
successfully\n']

But when I attempt something like:

    f = '%s %s %s' % string.split(eachLine, ',')

I get:

TypeError: not enough arguments for format string

How do I convert the output of string.split into something the format
operator is happy with?  I'm looking for an "oh well of COURSE" thing,
rather than looping over the output list and creating a tuple, assuming
one exists.

Thanx


Charles Krug




More information about the Python-list mailing list