[Tutor] 2 Import Or Not?

alan.gauld@bt.com alan.gauld@bt.com
Mon, 7 Oct 2002 17:33:38 +0100


> subsequently edit the file I've imported then it doesn't register the
> changes I've made. 

try to "reload()" the module.

Note that reload only works if you imported the module, not if you 
imported names from within the module. 

ie

import foo           # this will reload ok
from foo import bar  # this won't reload ok

print foo.bar

reload(foo)

HTH,

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld