realtime output and csv files

Joel Goldstick joel.goldstick at gmail.com
Fri Feb 5 17:12:36 EST 2016


On Fri, Feb 5, 2016 at 4:51 PM, Bernardo Sulzbach <mafagafogigante at gmail.com
> wrote:

> On 02/05/2016 07:43 PM, Joel Goldstick wrote:
>
>> print("%d, %2d:%2d, %.1f" % (1,10,24,20.4))
>>>>>
>>>> 1, 10:24, 20.4
>>
>
> Let us be more careful there. Although CSV has no formal specification
> (according to the IETF), *those spaces are not good*.
>
> It is **very unlikely** that they will cause issues, but 1,10:24,20.4 is
> *safer* and - to my eyes - better CSV.
>
> I wouldn't be surprised if a parser treated a value as text only because
> it has spaces on it.
>
> For OP, if you are going for this, I - personally - suggest sticking to
> "%d,%2d:%2d,%.1f".


Good point!

>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays


More information about the Python-list mailing list