Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58238
| Date | 2013-10-31 22:40 -0600 |
|---|---|
| From | Michael Torrie <torriem@gmail.com> |
| Subject | Re: Python wart |
| References | <l4v12j$98o$1@ger.gmane.org> <527314E9.2060507@gmail.com> <l4v58i$hg5$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1908.1383280843.18130.python-list@python.org> (permalink) |
On 10/31/2013 08:56 PM, Mark Lawrence wrote:
> On 01/11/2013 02:41, Michael Torrie wrote:
>> On 10/31/2013 07:45 PM, Mark Lawrence wrote:
>>> Quite often I type this
>>>
>>> print('Total of accounts %.2f', total)
>>>
>>> when I meant to type this
>>>
>>> print('Total of accounts %.2f' % total)
>>>
>>> Do I have to raise a PEP to get this stupid language changed so that it
>>> dynamically recognises what I want it to do and acts accordingly?
>>>
>>> Yours most frustratedly.
>>
>> This is one reason I've started using the new string formatting method
>> in all my new code.
>>
>
> I'll admit to being a lazy, bone idle git and not wanting to change my
> code as a former C programmer, but that strikes me as a cunning plan,
> thanks. Now where's my Windows desktop shortcut to the Python compiled
> help file? :)
I only know enough to do the basic stuff that works for me 3/4 of the
time.
"{} {} {}".format(one, two, three)
Anything more than that I have to look up! Sometimes the ability to use
keywords and dictionaries in variable placement is kind of nice.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Python wart Michael Torrie <torriem@gmail.com> - 2013-10-31 22:40 -0600
csiph-web