[Tutor] Problems 'reloading'/'reimporting' module
Tim Johnson
tim@johnsons-web.com
Sun Feb 9 18:08:03 2003
Found the solution:
must use import and reload together. Must also get
namespaces straight. :-)
Thanks
tim
* Tim Johnson <tim@johnsons-web.com> [030209 14:04]:
> Hello All:
> Is it possible to 'reimport' a module in
> python2.2 without restarting the interpreter?
>
> I'm not having any luck in either Linux Konsole
> or Xemacs python-mode.
>
> In Linux Konsole if I make changes to code and
> do
> from tlib import * # second time
> changes are not reflected.
>
> If I do reload(tlib)
> NameError: name 'tlib' is not defined
>
> However, if I do this in the python-mode interpreter
> window, I get what appears to be a successful reload
> >>> reload(tlib)
> <module 'tlib' from 'tlib.py'>
>
> but changes are not shown.
>
> Any help would be appreciated.
> TIA
> --
> Tim Johnson <tim@johnsons-web.com>
> http://www.alaska-internet-solutions.com
> http://www.johnsons-web.com
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Tim Johnson <tim@johnsons-web.com>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com