Re: range with variable leading zeros

2008-05-09 Thread yhvh
> > x = [0010, 0210] > > You do realize that this is octal, right? It's unfortunate I choose that, the numbers go beyond octal > len is undefined for integers.  Perhaps you meant "len(str(x[1]))". Yes sorry it was late at night :P > You can, however, do this: > >>> '%0*d' % (5, 123) > '00123' T

range with variable leading zeros

2008-05-08 Thread yhvh
I want to generate a range with variable leading zeros x = [0010, 0210] padding = len(x[1]) for j in range(x[0], x[1]): print (url).join('%0(pad)d(jj)'+'.jpg') %{'pad':padding, 'jj':j} This is syntactically incorrect, you can't insert a variable into the string format options. Any ideas? -

Re: error/warning color customization in interactive console?

2008-03-10 Thread yhvh
I've just discovered ipython - An Enhanced Interactive Python, which among other things colorizes output including error codes -- http://mail.python.org/mailman/listinfo/python-list

error/warning color customization in interactive console?

2008-01-15 Thread yhvh
Is it possible to output error messages in a different color? I'm using Terminal on Gnome. -- http://mail.python.org/mailman/listinfo/python-list