[IPython-User] prompt and config file questions

Richard D. Moores rdmoores@gmail....
Mon Sep 27 04:34:09 CDT 2010


On Mon, Sep 27, 2010 at 01:05, Richard D. Moores <rdmoores@gmail.com> wrote:
> 64-bit Vista
> Python 2.6
> IPython 0.10

> QUESTION 2.
>
> I'd like IPython to start with mpmath already imported. In
> ipy_user_conf.py I tried putting the 3 lines
>
> from mpmath import *
> mp.dps=25
> mp.pretty=True
>
> inside main() , and then above  def main() ,  but they are ignored.
> What's the correct way to do this?
>
> Of course, entering the line
> from mpmath import *;mp.dps=50;mp.pretty=True
> at the IPython prompt works.

Good old trial and error. I've been doing a lot of that, and tried
putting these 3 lines in main() in ipy_user_conf.py:

o.autoexec.append('from mpmath import *')
o.autoexec.append('mp.dps=40')
o.autoexec.append('mp.pretty=True')

They work, as can be seen:

[C:Python26/Scripts]
|18>fac(1000)
1[18] 4.023872600770937735437024339230039857194e+2567

So I think that takes care of Q2.

Dick


More information about the IPython-User mailing list