Re: How to print a number as if in the python interpreter?

2012-09-02 Thread me
Use repr() print(repr(sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]))) -- http://mail.python.org/mailman/listinfo/python-list

How to print a number as if in the python interpreter?

2012-07-06 Thread Peng Yu
Hi, In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) Out[2]: 0. In ipython, I got the above output. But I got a different output from print. Is there a way to print exact what I saw in ipython? ~/linux/test/python/man/library/math/fsum$ cat main.py #!/usr/bin/env python

Re: How to print a number as if in the python interpreter?

2012-07-06 Thread Chris Rebert
On Fri, Jul 6, 2012 at 3:38 PM, Peng Yu pengyu...@gmail.com wrote: Hi, In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) Out[2]: 0. In ipython, I got the above output. But I got a different output from print. Is there a way to print exact what I saw in ipython?