[IPython-dev] Engineering formatting

Stéfan van der Walt stefan at sun.ac.za
Sat Apr 24 14:35:42 EDT 2010


Hey Warren, Robert

On 21 April 2010 18:17, Warren Weckesser <warren.weckesser at enthought.com> wrote:
> Robert Kern wrote:
>> On 4/19/10 3:37 PM, Stéfan van der Walt wrote:
>>
>>> Hi all,
>>>
>>> This is probably an easy question, but how do I tweak IPython to
>>> display my numerical results in engineering notation?
>>>
>>
>> Use the pretty extension! In your ipy_user_conf.py:
[...]
> Following Robert's example, but defining float_eng_pprinter like this:
>
> def float_eng_pprinter(obj, p, cycle):
>   p.text(eng_format(obj))
[...]

Thanks for the code snippets!  I've put them into a profile and added
array printing (attached).  Maybe a useful profile to distribute?

Regards
Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipython_config_eng.py
Type: text/x-python-script
Size: 1672 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20100424/e3f4e988/attachment.bin>


More information about the IPython-dev mailing list