A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/131553.html below:

[Python-Dev] PEP 460 reboot

[Python-Dev] PEP 460 reboot [Python-Dev] PEP 460 rebootMark Lawrence breamoreboy at yahoo.co.uk
Tue Jan 14 22:17:02 CET 2014
On 14/01/2014 20:54, Guido van Rossum wrote:
> On Tue, Jan 14, 2014 at 12:13 PM, Ethan Furman <ethan at 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

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4