Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Bernardo Sulzbach Newsgroups: comp.lang.python Subject: Re: realtime output and csv files Date: Fri, 5 Feb 2016 19:51:19 -0200 Lines: 15 Message-ID: References: <56B51065.2090104@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de gZFBNLwCAXXmxT0SYuGICgPhrFjoXelzshuqI6pNAB4w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.113 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.78; '*S*': 0.00; 'csv': 0.09; 'subject:files': 0.09; 'suggest': 0.15; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'parser': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'spaces': 0.29; 'there.': 0.30; 'surprised': 0.33; 'message-id:@gmail.com': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:localhost.localdomain': 0.38; 'received:209': 0.38; 'received:localdomain': 0.38; 'to:addr:python.org': 0.40; 'personally': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'eyes': 0.70; '(according': 0.84; 'careful': 0.91; 'joel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=HQtOi0vywul7PAMCUaMLbc+Yj7xRzVUsSFqeor97sSc=; b=XTDMna4JtIwY6mKVEZ4WFioyeEcz3G/RpNK1CLWdy2b32HJRtGvhLmSy5S4JF4VZoO ZngAgwEB/oHlxpSVHgd2nxXb/+pJ2h8EaE7ioxYyKA8+KbkrDJR0ALFXuHjfmJ88/SLo CJwJY8PLT+7Ilx+nsIBWxogfBbtMSomjpbj8xyjwZRZwsZq0JEAR/Rc7EEursQvF0eh0 uCIBAM+gpfz2D7Wf2z08L6b6iQZvCdQPtE1+k64BpDjOGLqFwc2OcGLt69GGuY1N5Dql DCG1phqFbw3WWoTv66oob4sFPuqTo76Q2H9W4uGDsZnWG5PgSBvKFt8lV0T/7L6ANWGw 2GVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=HQtOi0vywul7PAMCUaMLbc+Yj7xRzVUsSFqeor97sSc=; b=QLDLhThrP5kUaT0ewOr94gX206hv27glLqPOioMMlW2NRs5gKXccCuA7fVblbpk5kn BzGkhij3SZFs+JWO+frWQ4It42+LzMI0CAi4yFGbAGZPYcBtqnO2NOOrUDmuILDXr2LP ZT9PpH/5KlE3rwRyxXKTM2QxD3VdAhNXpiMueFFAvLYjddw50nMLJ2BF529LdQ+nXwCL PETBF2qH/QmyPH5hdgf5BZF3/Cm6BUg+Yaw4LHi+2ipIM8NR2xcACEzCdUcbjO6Nqffe xcLOJzbSBufvYNf6WZuU/OOpsTuNDQ3uSuS/Zr00KmYUuwMZr6c0pmYZ4wuTgVBH4B0Y Od4Q== X-Gm-Message-State: AG10YOSeKMWvV4WfshgQmkzOQVaSwDgLEelm3z49nK6VWyte5wcg1+WQu6+dqMMGuZ74vQ== X-Received: by 10.140.28.133 with SMTP id 5mr12696726qgz.79.1454709082675; Fri, 05 Feb 2016 13:51:22 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102563 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".