Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'float': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'cases': 0.15; 'herman': 0.16; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'repr()': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'converted': 0.22; 'tried': 0.25; 'header:User- Agent:1': 0.26; 'values': 0.26; 'am,': 0.27; 'header:X-Complaints- To:1': 0.28; 'actual': 0.28; 'str': 0.29; 'sense': 0.31; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'there': 0.35; 'received:org': 0.36; 'michael': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '20,': 0.65; 'special': 0.73; '"".': 0.84; 'subject:Import': 0.84; 'subject:source': 0.84; 'rusi': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Import Json web data source to xls or csv Date: Thu, 21 Feb 2013 09:36:07 +0100 Organization: None References: <51240f54$0$40361$4fafbaef@reader1.news.tin.it> <1d72c9b7-8543-4a1b-9c25-5bdf280e36c3@ru10g2000pbc.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p5084bc5c.dip.t-dialin.net User-Agent: KNode/4.7.3 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361435751 news.xs4all.nl 6896 [2001:888:2000:d::a6]:56229 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39403 rusi wrote: > On Feb 20, 6:54 am, Michael Herman wrote: >> c = csv.writer(f) >> c.writerow([str(d["currency"]),str(d["symbol"]),str(d["bid"]), >> str(d["ask"]),str(d["currency_volume"])]) > Tried it with and without the str and there are small differences. The actual differences: float values are converted using repr() instead of str(), None values are converted to the empty str "". Both special cases make sense to me. So > Why do you use the str?