Re: String formatting strangeness

2005-05-13 Thread dark . ryder
*hides face* Groan! This is what I get for trying to code first thing in the morning. Thanks, all, it works fine now... -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting strangeness

2005-05-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > Traceback (most recent call last): > File "X:\Music (FLAC)\Post-process new rips.py", line 50, in ? > print "\t\t\t length=\"%i:%i\"/>\n" % [number, name, seconds // 60, seconds % 60] > TypeError: int argument required > > Wait, what? The first line clearly

Re: String formatting strangeness

2005-05-13 Thread Larry Bates
The argument to string format expression needs to be a tuple not a list. Also, all the string escaping makes this very hard to read. You can mix single and double quotes to achieve: print '\t\t\t\n' % \ (number, name, seconds // 60, seconds % 60) which IMHO is much easier to read. Larry

Re: String formatting strangeness

2005-05-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I must be doing something wrong, but for the life of me, I can't figure > out what. Here's the code snippet which is giving me grief: > > print type(number), type(name), type(seconds // 60), type(seconds % 60) > print "\t\t\t\n" > % [number, name, seconds // 60, seconds

String formatting strangeness

2005-05-13 Thread dark . ryder
I must be doing something wrong, but for the life of me, I can't figure out what. Here's the code snippet which is giving me grief: print type(number), type(name), type(seconds // 60), type(seconds % 60) print "\t\t\t\n" % [number, name, seconds // 60, seconds % 60] (These are lines 49 and 50 of