Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:script': 0.09; '(assuming': 0.16; 'commas,': 0.16; 'csv': 0.16; 'newlines': 0.16; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; 'file,': 0.19; 'later': 0.20; 'seems': 0.21; 'print': 0.22; 'header:User- Agent:1': 0.23; "aren't": 0.24; 'url:moin': 0.24; 'switch': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; "doesn't": 0.30; 'code': 0.31; 'that.': 0.31; 'url:wiki': 0.31; 'url:python': 0.33; '"the': 0.34; 'maybe': 0.34; 'problem.': 0.35; 'really': 0.36; 'module.': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'solving': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; 'email addr:gmail.com': 0.63; 'believe': 0.68; 'received:74.208': 0.68; 'received:74.208.4.194': 0.84 Date: Fri, 24 May 2013 15:24:26 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: Re: suppress newlines in my script References: <52c74908-8bac-498e-9549-5b9500b152f1@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:72R16Otsb+LyBvEgm1nB6yEH5T6uTeHPpm5If26osZe jQWnLRsp1gWBradRkryiy9i0y7fxNZoZheQl+0mROt4KOWcVUF YCAiVqgZCAW7dRezXnH9jF0PjltbyoSVYryTtxlh+G/pZhq70w hVcdkaqLEkllwol524c5phMECdJffQGsS1NdgNvdVXafYZ4EFw A1PLpYorkBdsBiuSiHNX4yvIjIhWo2eGUI6O29qnQyUjNTNM14 bWricnPqNMP4agrBa8754SPcMHv413BBmb2tU/QySFroHuWpKG c9Szxo6CxDy3DAu/k7iqpuJETMfseSn/rV0vBajaKpIR/LxJAs cIKgpKawibKtWix/tTjo= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369423480 news.xs4all.nl 15887 [2001:888:2000:d::a6]:52584 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45912 On 05/24/2013 09:59 AM, sloan949@gmail.com wrote: > >> print PE2.format(count) > > Thanks for the tip about the CSV module. I did not know about that. So why aren't you using it? There's not much point in solving "the newlines problem" if you're going to later switch to a library which doesn't have the problem. The csv module will eliminate the newlines, and the commas, organizing your data for you directly (assuming this really is a csv file, and that the separator is comma). None of your present code seems to believe it's a csv file, so maybe that's just a misdirection. -- DaveA