On 01/14/2014 01:17 PM, Mark Lawrence wrote:
On 14/01/2014 20:54, Guido van Rossum wrote:
On Tue, Jan 14, 2014 at 12:13 PM, Ethan Furman <et...@stoneleaf.us> wrote:
In Py2, because '%15s' can actually take 17 characters, I have to use '%15s'
% data_value[:15] everywhere.
Wow. I thought there would be some combination using %.15s but I can't
get that to work. :-(
I believe you wanted this.
a='01234567890123456'
len(a)
17
b = '%15.15s' % a
b;len(b)
'012345678901234'
15
Cool!
--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com