Developing with IPython

Hello,
I appologize for a slightly off topic post, but I'm sure someone here
knows the answer. I like the idea of developing code interactively
with IPython, but I cannot get past one hurdle. I would like to write
my code in a module that I then import and instantiate classes or call
functions from interactively. However, when I try to do this in
IPython I find that after I import my code, it is cached and even
after restarting and reimporting, the changes are not recognized. What
is the paradigm people use to get around this, or what is the
preferred paradigm for interactive development using IPython.
Thanks,
Glenn

2008/4/28 G Jones <glenn.caltech@...287...>:

Hello,
I appologize for a slightly off topic post, but I'm sure someone here
knows the answer.

You're probably right, and people are pretty happy to answer things
here in general. You're more likely to get traction for this question
on the IPython mailing list at <ipython-user at scipy.org>, to which I
have also sent this reply.

I like the idea of developing code interactively
with IPython, but I cannot get past one hurdle. I would like to write
my code in a module that I then import and instantiate classes or call
functions from interactively.

As far as I can tell, this is a popular and common approach, and one I
use exclusively.

However, when I try to do this in
IPython I find that after I import my code, it is cached and even
after restarting and reimporting, the changes are not recognized. What
is the paradigm people use to get around this, or what is the
preferred paradigm for interactive development using IPython.

The method you describe should work without any problem, suggesting to
me that something isn't quite right with your approach yet. Perhaps
you could give a concrete example so we can help debug the problem.

Angus.

···

--
AJC McMorland, PhD candidate
Physiology, University of Auckland

(Nearly) post-doctoral research fellow
Neurobiology, University of Pittsburgh

While I don't see any persistance across restarts of ipython - I do
within a session.

Check the reload command - which will reimport an already imported
module picking up any fresh changes in the source.

Cheers

Robin

···

On Tue, Apr 29, 2008 at 2:27 AM, G Jones <glenn.caltech@...287...> wrote:

Hello,
I appologize for a slightly off topic post, but I'm sure someone here
knows the answer. I like the idea of developing code interactively
with IPython, but I cannot get past one hurdle. I would like to write
my code in a module that I then import and instantiate classes or call
functions from interactively. However, when I try to do this in
IPython I find that after I import my code, it is cached and even
after restarting and reimporting, the changes are not recognized. What
is the paradigm people use to get around this, or what is the
preferred paradigm for interactive development using IPython.
Thanks,
Glenn