Is automatic reload of a module available in Python?

R (Chandra) Chandrasekhar chyavana at gmail.com
Wed Feb 17 09:27:35 EST 2010


Dear Folks,

I am currently developing a python program, let us call it "generic.py", 
and I am testing out the functions therein by testing them out 
interactively in the python interpreter by invoking python and doing

import generic

Once I hit an error, I need to revise my file and reload the module using

reload(generic)

The difference in syntax between invoking import and reload is really 
costing me time and patience.

Therefore, I would like to ask:

1. Is there a method of auto-reloading a module while developing it and 
testing it with the interactive python interpreter?

2. Is there a better way of developing a program?

Thank you.

Chandra



More information about the Python-list mailing list