Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41915
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | cl@isbd.net |
| Newsgroups | comp.lang.python |
| Subject | I need a neat way to print nothing or a number |
| Date | Tue, 26 Mar 2013 15:50:11 +0000 |
| Lines | 17 |
| Message-ID | <jms82a-6sl.ln1@chris.zbmc.eu> (permalink) |
| X-Trace | individual.net 8zqprb9FZwDDYtBbwJP2uAGt03CDn+gG9cRF1L2u0PEKSWfOw= |
| X-Orig-Path | not-for-mail |
| Cancel-Lock | sha1:KBOmp1v7TwjHg2UsVjTn4FB6hDY= sha1:l3UJpF5N4gCf8jDVWzEYQjv8xIM= |
| User-Agent | tin/2.1.1-20120623 ("Mulindry") (UNIX) (Linux/3.5.0-26-generic (x86_64)) |
| Xref | csiph.com comp.lang.python:41915 |
Show key headers only | View raw
What's a neat way to print columns of numbers with blanks where a number
is zero or None?
E.g. I want to output something like:-
Credit Debit Description
100.00 Initial balance
123.45 Payment for cabbages
202.00 Telephone bill
For each line I have either the credit or the debit amount and the other
is 0 or None. However you can't get number formatting (old or new) to
output a blank for 0 and it barfs on None.
--
Chris Green
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
I need a neat way to print nothing or a number cl@isbd.net - 2013-03-26 15:50 +0000 Re: I need a neat way to print nothing or a number Chris Angelico <rosuav@gmail.com> - 2013-03-27 03:08 +1100 Re: I need a neat way to print nothing or a number John Gordon <gordon@panix.com> - 2013-03-26 16:29 +0000 Re: I need a neat way to print nothing or a number Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-03-26 17:06 +0000 Re: I need a neat way to print nothing or a number Chris Angelico <rosuav@gmail.com> - 2013-03-27 04:14 +1100 Re: I need a neat way to print nothing or a number Peter Otten <__peter__@web.de> - 2013-03-26 18:22 +0100 Re: I need a neat way to print nothing or a number Ethan Furman <ethan@stoneleaf.us> - 2013-03-26 10:21 -0700 Re: I need a neat way to print nothing or a number Chris Angelico <rosuav@gmail.com> - 2013-03-27 05:48 +1100 Re: I need a neat way to print nothing or a number Tony the Tiger <tony@tiger.invalid> - 2013-03-27 01:11 -0500 Re: I need a neat way to print nothing or a number Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-03-27 08:23 +0000
csiph-web