tags:

views:

174

answers:

3

I am testing code in the python interpreter and editing in a separate window. I currently need to restart python whenever I make a change to the module I am testing.

Is there an easier way to do this?

Thanks,

Charlie

+11  A: 

The built-in function reload is what you're looking for.

avakar
+3  A: 

It sounds like you want to reload the module, for which there is a built-in function reload(module). That said, when I looked it up just now (to make sure I had my reference right, Google returned a couple of discussions (granted they are several years old) pointing out problems using reload(). You might want to review those if reload() causes you headaches.

acrosman
+1  A: 

Have a look at IPython http://ipython.scipy.org. It has various features that make working with Python code interactively easier.

Some screenshots and tips.

codeape