Proper way to reload a python module from the console

Posted by ensnare on Stack Overflow See other posts from Stack Overflow or by ensnare
Published on 2010-03-28T20:43:27Z Indexed on 2010/03/28 20:53 UTC
Read the original article Hit count: 204

Filed under:
|

I'm debugging from the python console and would like to reload a module every time I make a change so I don't have to exit the console and re-enter it. I'm doing:

>>> from project.model.user import *
>>> reload(user)

but I receive:

>>>NameError: name 'user' is not defined

What is the proper way to reload the entire user class? Is there a better way to do this, perhaps auto-updating while debugging?

Thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner