noob: reloading modified python file within Python Shell

Diez B. Roggisch deets at nospam.web.de
Mon Sep 10 21:34:56 CEST 2007


johnny schrieb:
> from people.models import *
> 
> Now I make changes to the models.py.  How do I reload this module in
> Python Shell?
> 

reload(module)

which works only with

import people.models

reload(people.models)

Which is better anyway, as the

from module import *

syntax will create local names that won't be changed by the reload.

Diez



More information about the Python-list mailing list