Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #4843
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Hermann Riemann <nospam.ng@hermann-riemann.de> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] { als Zeichen in Format |
| Date | Mon, 3 Jul 2017 15:07:23 +0200 |
| Lines | 24 |
| Message-ID | <erutscF2jrqU1@mid.individual.net> (permalink) |
| References | <eruls4Fp2pU1@mid.individual.net> <b90b0520-9c06-5658-de70-8d603a437529@sschwarzer.net> <mailman.23.1499080909.2926.python-de@python.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net Xte7skz+B+zFKw7+Y70XYAe0MjjqEN8Nj/hTaIr5xvQiGRbi8W |
| Cancel-Lock | sha1:uMm99I06XrhXz0ouGjIDCV2bfIM= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
| In-Reply-To | <mailman.23.1499080909.2926.python-de@python.org> |
| Content-Language | de-DE |
| Xref | csiph.com de.comp.lang.python:4843 |
Show key headers only | View raw
Am 03.07.2017 um 13:21 schrieb Stefan Schwarzer:
> On 2017-07-03 12:50, Hermann Riemann wrote:
>> computed_len=zahl=4 # Testzeile für Beispiel
>> s="{:%d}"%computed_len
>> print(s.format(zahl)) # Testzeile für Beispiel
>>
>> Wie setze ich die Zeile mit s= nach format um?
>
> Meinst du sowas:
>
>>>> "{{:{}d}}".format(5)
> '{:5d}'
> Ich habe das jetzt auf die Schnelle aber auch nicht in der Doku gefunden,
> sondern hatte eine vage Erinnerung, dass ich da mal was gelesen hatte.
Danke, die Verdoppelung war das gesuchte.
Hermann
der es auch nicht in seiner Doku (Python 3 Bücher) gefunden hat.
--
http://www.hermann-riemann.de
Back to de.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
{ als Zeichen in Format Hermann Riemann <nospam.ng@hermann-riemann.de> - 2017-07-03 12:50 +0200
Re: [Python-de] { als Zeichen in Format Stefan Schwarzer <sschwarzer@sschwarzer.net> - 2017-07-03 13:21 +0200
Re: [Python-de] { als Zeichen in Format Hermann Riemann <nospam.ng@hermann-riemann.de> - 2017-07-03 15:07 +0200
Re: [Python-de] { als Zeichen in Format Peter Otten <__peter__@web.de> - 2017-07-03 13:59 +0200
Re: [Python-de] { als Zeichen in Format Peter Otten <__peter__@web.de> - 2017-07-03 14:04 +0200
Re: [Python-de] { als Zeichen in Format Hermann Riemann <nospam.ng@hermann-riemann.de> - 2017-07-03 15:34 +0200
csiph-web